vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | assert(BigWigs, "BigWigs not found!") |
2 | |||
3 | ------------------------------ |
||
4 | -- Are you local? -- |
||
5 | ------------------------------ |
||
6 | |||
7 | local L = AceLibrary("AceLocale-2.2"):new("BigWigsRaidWarn") |
||
8 | |||
9 | ---------------------------- |
||
10 | -- Localization -- |
||
11 | ---------------------------- |
||
12 | |||
13 | L:RegisterTranslations("enUS", function() return { |
||
14 | ["RaidWarning"] = true, |
||
15 | |||
16 | ["raidwarn"] = true, |
||
17 | ["broadcast"] = true, |
||
18 | ["whisper"] = true, |
||
19 | ["useraidchannel"] = true, |
||
20 | |||
21 | ["Broadcast over RaidWarning"] = true, |
||
22 | ["Broadcast"] = true, |
||
23 | ["Toggle broadcasting over Raidwarning."] = true, |
||
24 | |||
25 | ["Whisper"] = true, |
||
26 | ["Whisper warnings"] = true, |
||
27 | ["Toggle whispering warnings to players."] = true, |
||
28 | |||
29 | ["Use Raidchannel"] = true, |
||
30 | ["Toggle using the raid channel instead of the raid warning channel for boss messages."] = true, |
||
31 | |||
32 | ["Options for RaidWarning."] = true, |
||
33 | } end ) |
||
34 | |||
35 | L:RegisterTranslations("koKR", function() return { |
||
36 | ["RaidWarning"] = "공격대 경고", |
||
37 | |||
38 | ["Broadcast over RaidWarning"] = "공격대 경고로 알림", |
||
39 | ["Broadcast"] = "알림", |
||
40 | ["Toggle broadcasting over Raidwarning."] = "공격대 경고로 알림 토글", |
||
41 | |||
42 | ["Whisper"] = "귓속말", |
||
43 | ["Whisper warnings"] = "귓속말 경고", |
||
44 | ["Toggle whispering warnings to players."] = "플레이어에게 귓속말 경고 알림 토글", |
||
45 | |||
46 | ["Use Raidchannel"] = "공격대 채널 사용", |
||
47 | ["Toggle using the raid channel instead of the raid warning channel for boss messages."] = "공격대 경고 혹은 채널 사용 토글", |
||
48 | |||
49 | ["Options for RaidWarning."] = "공격대 경고 설정", |
||
50 | |||
51 | } end ) |
||
52 | |||
53 | L:RegisterTranslations("zhCN", function() return { |
||
54 | ["RaidWarning"] = "团队警报", |
||
55 | |||
56 | ["raidwarn"] = "团队警报", |
||
57 | ["broadcast"] = "广播", |
||
58 | ["whisper"] = "密语", |
||
59 | ["useraidchannel"] = "使用团队聊天", |
||
60 | |||
61 | ["Broadcast over RaidWarning"] = "通过团队警告频道发送信息", |
||
62 | ["Broadcast"] = "广播", |
||
63 | ["Toggle broadcasting over Raidwarning."] = "切换是否通过团队警告频道发送信息", |
||
64 | |||
65 | ["Whisper"] = "密语", |
||
66 | ["Whisper warnings"] = "密语警报", |
||
67 | ["Toggle whispering warnings to players."] = "切换是否通过密语向玩家发送信息", |
||
68 | |||
69 | ["Use Raidchannel"] = "使用团队聊天", |
||
70 | ["Toggle using the raid channel instead of the raid warning channel for boss messages."] = "切换是否使用团队聊天来代替团队警告频道来播放boss的信息", |
||
71 | |||
72 | ["Options for RaidWarning."] = "团队警告设置", |
||
73 | } end ) |
||
74 | |||
75 | |||
76 | L:RegisterTranslations("zhTW", function() return { |
||
77 | ["RaidWarning"] = "團隊警報", |
||
78 | |||
79 | ["raidwarn"] = "團隊警報", |
||
80 | ["broadcast"] = "廣播", |
||
81 | ["whisper"] = "密語", |
||
82 | ["useraidchannel"] = "使用團隊聊天", |
||
83 | |||
84 | ["Broadcast over RaidWarning"] = "通過團隊警告頻道發送訊息", |
||
85 | ["Broadcast"] = "廣播", |
||
86 | ["Toggle broadcasting over Raidwarning."] = "切換是否通過團隊警告頻道發送訊息", |
||
87 | |||
88 | ["Whisper"] = "密語", |
||
89 | ["Whisper warnings"] = "密語警報", |
||
90 | ["Toggle whispering warnings to players."] = "切換是否通過密語向玩家發送訊息", |
||
91 | |||
92 | ["Use Raidchannel"] = "使用團隊聊天", |
||
93 | ["Toggle using the raid channel instead of the raid warning channel for boss messages."] = "切換是否使用團隊聊天來代替團隊警告頻道來播放boss的訊息", |
||
94 | |||
95 | ["Options for RaidWarning."] = "團隊警告選項", |
||
96 | } end ) |
||
97 | |||
98 | L:RegisterTranslations("deDE", function() return { |
||
99 | ["RaidWarning"] = "RaidWarnung", |
||
100 | |||
101 | --["raidwarn"] = "raidwarnen", |
||
102 | --["broadcast"] = "verbreiten", |
||
103 | --["whisper"] = "fl\195\188stern", |
||
104 | --["useraidchannel"] = "raidchatbenutzen", |
||
105 | |||
106 | ["Broadcast over RaidWarning"] = "Verbreiten \195\188ber Sclachtzugswarnung", |
||
107 | ["Broadcast"] = "Verbreiten", |
||
108 | ["Toggle broadcasting over Raidwarning."] = "Meldungen \195\188ber Schlachtzugswarnung an Alle senden.", |
||
109 | |||
110 | ["Whisper"] = "Fl\195\188stern", |
||
111 | ["Whisper warnings"] = "Warnungen fl\195\188stern", |
||
112 | ["Toggle whispering warnings to players."] = "Warnungen an andere Spieler fl\195\188stern.", |
||
113 | |||
114 | ["Use Raidchannel"] = "Schlachtzugschat benutzen", |
||
115 | ["Toggle using the raid channel instead of the raid warning channel for boss messages."] = "Schlachtzugschat anstelle des Schlachtzugswarungschats für Boss Nachrichten benutzen.", |
||
116 | |||
117 | ["Options for RaidWarning."] = "Optionen f\195\188r RaidWarnung.", |
||
118 | } end ) |
||
119 | |||
120 | L:RegisterTranslations("frFR", function() return { |
||
121 | ["RaidWarning"] = "Avertissement du raid", |
||
122 | |||
123 | ["Broadcast over RaidWarning"] = "Diffuser sur l'Avertissement Raid", |
||
124 | ["Broadcast"] = "Diffuser", |
||
125 | ["Toggle broadcasting over Raidwarning."] = "Diffuse ou non les messages sur l'Avertissement Raid.", |
||
126 | |||
127 | ["Whisper"] = "Chuchoter", |
||
128 | ["Whisper warnings"] = "Chuchoter les avertissements", |
||
129 | ["Toggle whispering warnings to players."] = "Chuchote ou non les avertissements aux joueurs.", |
||
130 | |||
131 | ["Use Raidchannel"] = "Utiliser le canal Raid", |
||
132 | ["Toggle using the raid channel instead of the raid warning channel for boss messages."] = "Utilise ou non le canal Raid au lieu de l'Avertissement Raid pour les messages des boss.", |
||
133 | |||
134 | ["Options for RaidWarning."] = "Options concernant l'Avertissement du Raid.", |
||
135 | } end ) |
||
136 | |||
137 | ---------------------------------- |
||
138 | -- Module Declaration -- |
||
139 | ---------------------------------- |
||
140 | |||
141 | BigWigsRaidWarn = BigWigs:NewModule(L["RaidWarning"]) |
||
142 | BigWigsRaidWarn.defaultDB = { |
||
143 | whisper = false, |
||
144 | broadcast = false, |
||
145 | useraidchannel = false, |
||
146 | } |
||
147 | BigWigsRaidWarn.consoleCmd = L["raidwarn"] |
||
148 | BigWigsRaidWarn.consoleOptions = { |
||
149 | type = "group", |
||
150 | name = L["RaidWarning"], |
||
151 | desc = L["Options for RaidWarning."], |
||
152 | args = { |
||
153 | [L["broadcast"]] = { |
||
154 | type = "toggle", |
||
155 | name = L["Broadcast"], |
||
156 | desc = L["Toggle broadcasting over Raidwarning."], |
||
157 | get = function() return BigWigsRaidWarn.db.profile.broadcast end, |
||
158 | set = function(v) BigWigsRaidWarn.db.profile.broadcast = v end, |
||
159 | }, |
||
160 | [L["whisper"]] = { |
||
161 | type = "toggle", |
||
162 | name = L["Whisper"], |
||
163 | desc = L["Toggle whispering warnings to players."], |
||
164 | get = function() return BigWigsRaidWarn.db.profile.whisper end, |
||
165 | set = function(v) BigWigsRaidWarn.db.profile.whisper = v end, |
||
166 | }, |
||
167 | [L["useraidchannel"]] = { |
||
168 | type = "toggle", |
||
169 | name = L["Use Raidchannel"], |
||
170 | desc = L["Toggle using the raid channel instead of the raid warning channel for boss messages."], |
||
171 | get = function() return BigWigsRaidWarn.db.profile.useraidchannel end, |
||
172 | set = function(v) BigWigsRaidWarn.db.profile.useraidchannel = v end, |
||
173 | }, |
||
174 | } |
||
175 | } |
||
176 | |||
177 | ------------------------------ |
||
178 | -- Initialization -- |
||
179 | ------------------------------ |
||
180 | |||
181 | function BigWigsRaidWarn:OnEnable() |
||
182 | self:RegisterEvent("BigWigs_Message") |
||
183 | self:RegisterEvent("BigWigs_SendTell") |
||
184 | end |
||
185 | |||
186 | function BigWigsRaidWarn:BigWigs_Message(msg, color, noraidsay) |
||
187 | if not self.db.profile.broadcast or not msg or noraidsay or ( not IsRaidLeader() and not IsRaidOfficer() ) then |
||
188 | return |
||
189 | end |
||
190 | if self.db.profile.useraidchannel then |
||
191 | SendChatMessage("*** "..msg.." ***", "RAID") |
||
192 | else |
||
193 | SendChatMessage("*** "..msg.." ***", "RAID_WARNING") |
||
194 | end |
||
195 | end |
||
196 | |||
197 | function BigWigsRaidWarn:BigWigs_SendTell(player, msg ) |
||
198 | if not self.db.profile.whisper or not player or not msg or ( not IsRaidLeader() and not IsRaidOfficer() ) then return end |
||
199 | SendChatMessage(msg, "WHISPER", nil, player) |
||
200 | end |
||
201 | |||
202 |