vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
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("BigWigsRaidIcon")
8 local lastplayer = nil
9  
10 ----------------------------
11 -- Localization --
12 ----------------------------
13  
14 L:RegisterTranslations("enUS", function() return {
15 ["Raid Icons"] = true,
16  
17 ["raidicon"] = true,
18 ["place"] = true,
19 ["icon"] = true,
20  
21 ["Place"] = true,
22 ["Place Raid Icons"] = true,
23 ["Toggle placing of Raid Icons on players."] = true,
24  
25 ["Icon"] = true,
26 ["Set Icon"] = true,
27 ["Set which icon to place on players."] = true,
28  
29 ["Options for Raid Icons."] = true,
30  
31 ["star"] = true,
32 ["circle"] = true,
33 ["diamond"] = true,
34 ["triangle"] = true,
35 ["moon"] = true,
36 ["square"] = true,
37 ["cross"] = true,
38 ["skull"] = true,
39 } end )
40  
41 L:RegisterTranslations("koKR", function() return {
42 ["Raid Icons"] = "공격대 아이콘",
43  
44 ["Place"] = "지정",
45 ["Place Raid Icons"] = "공격대 아이콘 지정",
46 ["Toggle placing of Raid Icons on players."] = "플레이어에 공격대 아이콘 지정 토글",
47  
48 ["Icon"] = "아이콘",
49 ["Set Icon"] = "아이콘 설정",
50 ["Set which icon to place on players."] = "플레이어에 아이콘 지정을 위한 설정",
51  
52 ["Options for Raid Icons."] = "공격대 아이콘에 대한 설정",
53  
54 ["star"] = "별",
55 ["circle"] = "원",
56 ["diamond"] = "다이아몬드",
57 ["triangle"] = "세모",
58 ["moon"] = "달",
59 ["square"] = "네모",
60 ["cross"] = "가위표",
61 ["skull"] = "해골",
62  
63 } end )
64  
65 L:RegisterTranslations("zhCN", function() return {
66 ["Raid Icons"] = "团队图标",
67  
68 ["Place"] = "标记",
69 ["Place Raid Icons"] = "标记团队图标",
70 ["Toggle placing of Raid Icons on players."] = "切换是否在玩家身上标记团队图标",
71  
72 ["Icon"] = "图标",
73 ["Set Icon"] = "设置图标",
74 ["Set which icon to place on players."] = "设置玩家身上标记的图标。",
75  
76 ["Options for Raid Icons."] = "团队图标设置",
77  
78 ["star"] = "星星",
79 ["circle"] = "圆圈",
80 ["diamond"] = "钻石",
81 ["triangle"] = "三角",
82 ["moon"] = "月亮",
83 ["square"] = "方形",
84 ["cross"] = "十字",
85 ["skull"] = "骷髅",
86 } end )
87  
88 L:RegisterTranslations("zhTW", function() return {
89 ["Raid Icons"] = "團隊圖示",
90  
91 ["Place"] = "標記",
92 ["Place Raid Icons"] = "標記團隊圖示",
93 ["Toggle placing of Raid Icons on players."] = "切換是否在玩家身上標記團隊圖示",
94  
95 ["Icon"] = "圖標",
96 ["Set Icon"] = "設置圖示",
97 ["Set which icon to place on players."] = "設置玩家身上標記的圖示。",
98  
99 ["Options for Raid Icons."] = "團隊圖示設置",
100  
101 ["star"] = "星星",
102 ["circle"] = "圓圈",
103 ["diamond"] = "方塊",
104 ["triangle"] = "三角",
105 ["moon"] = "月亮",
106 ["square"] = "方形",
107 ["cross"] = "十字",
108 ["skull"] = "骷髏",
109 } end )
110  
111 L:RegisterTranslations("deDE", function() return {
112 ["Raid Icons"] = "Schlachtzug-Symbole",
113  
114 --["raidicon"] = "schlachtzugsymbol",
115 --["place"] = "position",
116 --["icon"] = "symbol",
117  
118 ["Place"] = "Platzierung",
119 ["Place Raid Icons"] = "Schlachtzug-Symbole platzieren",
120 ["Toggle placing of Raid Icons on players."] = "Schlachtzug-Symbole auf Spieler setzen.",
121  
122 ["Icon"] = "Symbol",
123 ["Set Icon"] = "Symbol platzieren",
124 ["Set which icon to place on players."] = "W\195\164hle, welches Symbol auf Spieler gesetzt wird.",
125  
126 ["Options for Raid Icons."] = "Optionen f\195\188r Schlachtzug-Symbole.",
127  
128 ["star"] = "Stern",
129 ["circle"] = "Kreis",
130 ["diamond"] = "Diamant",
131 ["triangle"] = "Dreieck",
132 ["moon"] = "Mond",
133 ["square"] = "Quadrat",
134 ["cross"] = "Kreuz",
135 ["skull"] = "Totenkopf",
136 } end )
137  
138 L:RegisterTranslations("frFR", function() return {
139 ["Raid Icons"] = "Icônes de raid",
140  
141 ["Place"] = "Placement",
142 ["Place Raid Icons"] = "Placer les icônes de raid",
143 ["Toggle placing of Raid Icons on players."] = "Place ou non les icônes de raid sur les joueurs.",
144  
145 ["Icon"] = "Icône",
146 ["Set Icon"] = "Déterminer l'icône",
147 ["Set which icon to place on players."] = "Détermine quelle icône sera placée sur les joueurs.",
148  
149 ["Options for Raid Icons."] = "Options concernant les icônes de raid.",
150  
151 ["star"] = "étoile",
152 ["circle"] = "cercle",
153 ["diamond"] = "diamant",
154 ["triangle"] = "triangle",
155 ["moon"] = "lune",
156 ["square"] = "carré",
157 ["cross"] = "croix",
158 ["skull"] = "crâne",
159 } end )
160  
161 ----------------------------------
162 -- Module Declaration --
163 ----------------------------------
164  
165 BigWigsRaidIcon = BigWigs:NewModule(L["Raid Icons"])
166 BigWigsRaidIcon.defaultDB = {
167 place = true,
168 icon = L["skull"],
169 }
170 BigWigsRaidIcon.icontonumber = {
171 [L["star"]] = 1,
172 [L["circle"]] = 2,
173 [L["diamond"]] = 3,
174 [L["triangle"]] = 4,
175 [L["moon"]] = 5,
176 [L["square"]] = 6,
177 [L["cross"]] = 7,
178 [L["skull"]] = 8,
179 }
180 BigWigsRaidIcon.consoleCmd = L["raidicon"]
181 BigWigsRaidIcon.consoleOptions = {
182 type = "group",
183 name = L["Raid Icons"],
184 desc = L["Options for Raid Icons."],
185 args = {
186 [L["place"]] = {
187 type = "toggle",
188 name = L["Place Raid Icons"],
189 desc = L["Toggle placing of Raid Icons on players."],
190 get = function() return BigWigsRaidIcon.db.profile.place end,
191 set = function(v) BigWigsRaidIcon.db.profile.place = v end,
192 },
193 [L["icon"]] = {
194 type = "text",
195 name = L["Set Icon"],
196 desc = L["Set which icon to place on players."],
197 get = function() return BigWigsRaidIcon.db.profile.icon end,
198 set = function(v) BigWigsRaidIcon.db.profile.icon = v end,
199 validate = {L["star"], L["circle"], L["diamond"], L["triangle"], L["moon"], L["square"], L["cross"], L["skull"] },
200 },
201 }
202 }
203  
204 ------------------------------
205 -- Initialization --
206 ------------------------------
207  
208 function BigWigsRaidIcon:OnEnable()
209 self:RegisterEvent("BigWigs_SetRaidIcon")
210 self:RegisterEvent("BigWigs_RemoveRaidIcon")
211 end
212  
213 function BigWigsRaidIcon:BigWigs_SetRaidIcon(player)
214 if not self.db.profile.place or not player then return end
215 local icon = self.db.profile.icon
216 if not self.icontonumber[icon] then
217 icon = L["skull"]
218 end
219 icon = self.icontonumber[icon]
220 for i=1,GetNumRaidMembers() do
221 if UnitName("raid"..i) == player then
222 if not GetRaidTargetIndex("raid"..i) then
223 SetRaidTargetIcon("raid"..i, icon)
224 lastplayer = player
225 end
226 end
227 end
228 end
229  
230 function BigWigsRaidIcon:BigWigs_RemoveRaidIcon()
231 if not self.db.profile.place or not lastplayer then return end
232 for i=1,GetNumRaidMembers() do
233 if UnitName("raid"..i) == lastplayer then
234 SetRaidTargetIcon("raid"..i, 0)
235 end
236 end
237 lastplayer = nil
238 end