vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | local VERSION_MAJOR = "1"; |
2 | local VERSION_MINOR = "17"; |
||
3 | local VERSION_BOSSES = "04"; |
||
4 | ATLASLOOT_VERSION = "|cff4169e1AtlasLoot Enhanced v"..VERSION_MAJOR.."."..VERSION_MINOR.."."..VERSION_BOSSES.."|r"; |
||
5 | ATLASLOOT_CURRENT_ATLAS = "1.7.5"; |
||
6 | |||
7 | -- Colours stored for code readability |
||
8 | local GREY = "|cff999999"; |
||
9 | local RED = "|cffff0000"; |
||
10 | local WHITE = "|cffFFFFFF"; |
||
11 | local GREEN = "|cff1eff00"; |
||
12 | local PURPLE = "|cff9F3FFF"; |
||
13 | local BLUE = "|cff0070dd"; |
||
14 | local ORANGE = "|cffFF8400"; |
||
15 | |||
16 | local ATLAS_LOOT_BOSS_LINES = 27; |
||
17 | |||
18 | local AtlasLoot_AnchorFrame = AtlasFrame; -- Added |
||
19 | |||
20 | local Hooked_Atlas_Refresh; |
||
21 | |||
22 | -- Initialise saved variables |
||
23 | if(AtlasLootOptions == nil) then |
||
24 | AtlasLootOptions = {}; |
||
25 | end |
||
26 | |||
27 | if ( AtlasLootOptions["SafeLinks"] == nil ) then |
||
28 | AtlasLootOptions["SafeLinks"] = true; |
||
29 | end |
||
30 | if ( AtlasLootOptions["AllLinks"] == nil ) then |
||
31 | AtlasLootOptions["AllLinks"] = false; |
||
32 | end |
||
33 | if ( AtlasLootOptions["DefaultTT"] == nil ) then |
||
34 | AtlasLootOptions["DefaultTT"] = true; |
||
35 | end |
||
36 | if ( AtlasLootOptions["LootlinkTT"] == nil ) then |
||
37 | AtlasLootOptions["LootlinkTT"] = false; |
||
38 | end |
||
39 | if ( AtlasLootOptions["ItemSyncTT"] == nil ) then |
||
40 | AtlasLootOptions["ItemSyncTT"] = false; |
||
41 | end |
||
42 | if ( AtlasLootOptions["EquipCompare"] == nil ) then |
||
43 | AtlasLootOptions["EquipCompare"] = false; |
||
44 | end |
||
45 | |||
46 | -- Popup Box for first time users |
||
47 | StaticPopupDialogs["ATLASLOOT_SETUP"] = { |
||
48 | text = ATLASLOOT_FIRST_TIME_TEXT, |
||
49 | button1 = ATLASLOOT_FIRST_TIME_BUTTON, |
||
50 | OnAccept = function() |
||
51 | AtlasLootOptions_Toggle(); |
||
52 | end, |
||
53 | timeout = 0, |
||
54 | whileDead = 1, |
||
55 | hideOnEscape = 1 |
||
56 | }; |
||
57 | |||
58 | --Popup Box for an old version of Atlas |
||
59 | StaticPopupDialogs["ATLASLOOT_OLD_ATLAS"] = { |
||
60 | text = ATLASLOOT_OLD_ATLAS_TEXT_PT1..ATLASLOOT_CURRENT_ATLAS..ATLASLOOT_OLD_ATLAS_TEXT_PT2, |
||
61 | button1 = ATLASLOOT_OLD_ATLAS_BUTTON, |
||
62 | OnAccept = function() |
||
63 | AtlasLootOptions_Toggle(); |
||
64 | end, |
||
65 | timeout = 0, |
||
66 | whileDead = 1, |
||
67 | hideOnEscape = 1 |
||
68 | }; |
||
69 | |||
70 | -------------------------------------------------------------------------------- |
||
71 | -- OnEvent |
||
72 | -------------------------------------------------------------------------------- |
||
73 | function AtlasLoot_OnEvent(event) |
||
74 | if(event == "VARIABLES_LOADED") then |
||
75 | AtlasLoot_OnVariablesLoaded(); |
||
76 | end |
||
77 | end |
||
78 | |||
79 | |||
80 | -------------------------------------------------------------------------------- |
||
81 | -- OnEvent - VariablesLoaded |
||
82 | -- When the game has loaded all variables, initialise the mod |
||
83 | -------------------------------------------------------------------------------- |
||
84 | function AtlasLoot_OnVariablesLoaded() |
||
85 | Hooked_Atlas_Refresh = Atlas_Refresh; |
||
86 | Atlas_Refresh = AtlasLoot_Refresh; |
||
87 | AtlasLoot_Refresh(); |
||
88 | --Disable options that don't have the supporting mods |
||
89 | if( not LootLink_SetTooltip and (AtlasLootOptions.LootlinkTT == true)) then |
||
90 | AtlasLootOptions.LootlinkTT = false; |
||
91 | AtlasLootOptions.DefaultTT = true; |
||
92 | end |
||
93 | if( not ISYNC_VERSION and (AtlasLootOptions.ItemSyncTT == true)) then |
||
94 | AtlasLootOptions.ItemSyncTT = false; |
||
95 | AtlasLootOptions.DefaultTT = true; |
||
96 | end |
||
97 | if( not EquipCompare_RegisterTooltip and (AtlasLootOptions.EquipCompare == true)) then |
||
98 | AtlasLootOptions.EquipCompare = false; |
||
99 | end |
||
100 | if((EquipCompare_RegisterTooltip) and (AtlasLootOptions["EquipCompare"] == true)) then |
||
101 | EquipCompare_RegisterTooltip(AtlasLootTooltip); |
||
102 | end |
||
103 | if ( Hooked_Atlas_Refresh ) then |
||
104 | AtlasLoot_SetupForAtlas(); |
||
105 | --If a first time user, set up options |
||
106 | if( (AtlasLootVersion == nil) or (tonumber(AtlasLootVersion) < 11402)) then |
||
107 | AtlasLootOptions["SafeLinks"] = true; |
||
108 | AtlasLootOptions["AllLinks"] = false; |
||
109 | AtlasLootVersion = VERSION_MAJOR..VERSION_MINOR..VERSION_BOSSES; |
||
110 | StaticPopup_Show ("ATLASLOOT_SETUP"); |
||
111 | end |
||
112 | --If not the expected Atlas version |
||
113 | if( ATLAS_VERSION ~= ATLASLOOT_CURRENT_ATLAS ) then |
||
114 | StaticPopup_Show ("ATLASLOOT_OLD_ATLAS"); |
||
115 | end |
||
116 | else |
||
117 | AtlasLootItemsFrame:Hide(); |
||
118 | end |
||
119 | end |
||
120 | |||
121 | --If someone types /atlasloot, bring up the options box |
||
122 | function AtlasLoot_SlashCommand(msg) |
||
123 | if(msg == "**") then |
||
124 | AtlasLootOptions_Toggle(); |
||
125 | else |
||
126 | AtlasLootOptions_Toggle(); |
||
127 | end |
||
128 | end |
||
129 | |||
130 | --Toggle on/off the options window |
||
131 | function AtlasLootOptions_Toggle() |
||
132 | if(AtlasLootOptionsFrame:IsVisible()) then |
||
133 | AtlasLootOptionsFrame:Hide(); |
||
134 | else |
||
135 | AtlasLootOptionsFrame:Show(); |
||
136 | if(AtlasLootOptions["DefaultTT"] == true) then |
||
137 | AtlasLootOptions_DefaultTTToggle(); |
||
138 | elseif(AtlasLootOptions["LootlinkTT"] == true) then |
||
139 | AtlasLootOptions_LootlinkTTToggle(); |
||
140 | elseif(AtlasLootOptions["ItemSyncTT"] == true) then |
||
141 | AtlasLootOptions_ItemSyncTTToggle(); |
||
142 | end |
||
143 | end |
||
144 | end |
||
145 | |||
146 | -------------------------------------------------------------------------------- |
||
147 | -- OnLoad |
||
148 | -- When the mod loads, register to complete initialisation when |
||
149 | -- everything else is loaded. |
||
150 | -------------------------------------------------------------------------------- |
||
151 | function AtlasLoot_OnLoad() |
||
152 | this:RegisterEvent("VARIABLES_LOADED"); |
||
153 | SLASH_ATLASLOOT1 = "/atlasloot"; |
||
154 | SlashCmdList["ATLASLOOT"] = function(msg) |
||
155 | AtlasLoot_SlashCommand(msg); |
||
156 | end |
||
157 | end |
||
158 | |||
159 | -------------------------------------------------------------------------------- |
||
160 | -- Item OnEnter |
||
161 | -- Called when a loot item is moused over |
||
162 | -------------------------------------------------------------------------------- |
||
163 | function AtlasLootItem_OnEnter() |
||
164 | local yOffset; |
||
165 | if(this.itemID ~= 0 and this.itemID ~= "" and this.itemID ~= nil) then |
||
166 | Identifier = "Item"..this.itemID; |
||
167 | DKP = DKPValues[Identifier]; |
||
168 | else |
||
169 | DKP = nil; |
||
170 | end |
||
171 | --Lootlink tooltips |
||
172 | if( AtlasLootOptions.LootlinkTT ) then |
||
173 | --If we have seen the item, use the game tooltip to minimise same name item problems |
||
174 | if(GetItemInfo(this.itemID) ~= nil) then |
||
175 | AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24); |
||
176 | AtlasLootTooltip:SetHyperlink("item:"..this.itemID..":0:0:0"); |
||
177 | if( this.droprate ~= nil) then |
||
178 | AtlasLootTooltip:AddLine(ATLASLOOT_DROP_RATE..this.droprate, 1, 1, 0); |
||
179 | end |
||
180 | if( DKP ~= nil and DKP ~= "" ) then |
||
181 | AtlasLootTooltip:AddLine(RED..DKP.." "..ATLASLOOT_DKP, 1, 1, 0); |
||
182 | end |
||
183 | AtlasLootTooltip:Show(); |
||
184 | else |
||
185 | AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24); |
||
186 | LootLink_SetTooltip(AtlasLootTooltip, strsub(getglobal("AtlasLootItem_"..this:GetID().."_Name"):GetText(), 11), 1); |
||
187 | if( this.droprate ~= nil) then |
||
188 | AtlasLootTooltip:AddLine(ATLASLOOT_DROP_RATE..this.droprate, 1, 1, 0); |
||
189 | end |
||
190 | if( DKP ~= nil and DKP ~= "" ) then |
||
191 | AtlasLootTooltip:AddLine(RED..DKP.." "..ATLASLOOT_DKP, 1, 1, 0); |
||
192 | end |
||
193 | AtlasLootTooltip:Show(); |
||
194 | end |
||
195 | --Item Sync tooltips |
||
196 | elseif( AtlasLootOptions.ItemSyncTT ) then |
||
197 | ISync:ButtonEnter(); |
||
198 | if( this.droprate ~= nil) then |
||
199 | GameTooltip:AddLine(ATLASLOOT_DROP_RATE..this.droprate, 1, 1, 0); |
||
200 | GameTooltip:Show(); |
||
201 | end |
||
202 | if( DKP ~= nil and DKP ~= "" ) then |
||
203 | AtlasLootTooltip:AddLine(RED..DKP.." "..ATLASLOOT_DKP, 1, 1, 0); |
||
204 | end |
||
205 | --Default game tooltips |
||
206 | else |
||
207 | if(this.itemID ~= nil and GetItemInfo(this.itemID) ~= nil) then |
||
208 | AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24); |
||
209 | AtlasLootTooltip:SetHyperlink("item:"..this.itemID..":0:0:0"); |
||
210 | if( this.droprate ~= nil) then |
||
211 | AtlasLootTooltip:AddLine(ATLASLOOT_DROP_RATE..this.droprate, 1, 1, 0); |
||
212 | end |
||
213 | if( DKP ~= nil and DKP ~= "" ) then |
||
214 | AtlasLootTooltip:AddLine(RED..DKP.." "..ATLASLOOT_DKP, 1, 1, 0); |
||
215 | end |
||
216 | AtlasLootTooltip:Show(); |
||
217 | end |
||
218 | end |
||
219 | end |
||
220 | |||
221 | -------------------------------------------------------------------------------- |
||
222 | -- Item OnLeave |
||
223 | -- Called when the mouse cursor leaves a loot item |
||
224 | -------------------------------------------------------------------------------- |
||
225 | function AtlasLootItem_OnLeave() |
||
226 | --Hide the necessary tooltips |
||
227 | if( AtlasLootOptions.LootlinkTT ) then |
||
228 | AtlasLootTooltip:Hide(); |
||
229 | elseif( AtlasLootOptions.ItemSyncTT ) then |
||
230 | if(GameTooltip:IsVisible()) then |
||
231 | GameTooltip:Hide(); |
||
232 | end |
||
233 | else |
||
234 | if(this.itemID ~= nil) then |
||
235 | AtlasLootTooltip:Hide(); |
||
236 | GameTooltip:Hide(); |
||
237 | end |
||
238 | end |
||
239 | end |
||
240 | |||
241 | -------------------------------------------------------------------------------- |
||
242 | -- Item OnClick |
||
243 | -- Called when a loot item is clicked on |
||
244 | -------------------------------------------------------------------------------- |
||
245 | function AtlasLootItem_OnClick() |
||
246 | local color = strsub(getglobal("AtlasLootItem_"..this:GetID().."_Name"):GetText(), 1, 10); |
||
247 | local id = this:GetID(); |
||
248 | local name = strsub(getglobal("AtlasLootItem_"..this:GetID().."_Name"):GetText(), 11); |
||
249 | local iteminfo = GetItemInfo(this.itemID); |
||
250 | --If shift-clicked, link in the chat window |
||
251 | if(ChatFrameEditBox:IsVisible() and IsShiftKeyDown() and iteminfo and (AtlasLootOptions.SafeLinks or AtlasLootOptions.AllLinks)) then |
||
252 | ChatFrameEditBox:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..name.."]|h|r"); |
||
253 | elseif(ChatFrameEditBox:IsVisible() and IsShiftKeyDown() and AtlasLootOptions.AllLinks) then |
||
254 | ChatFrameEditBox:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..name.."]|h|r"); |
||
255 | elseif(ChatFrameEditBox:IsVisible()) then |
||
256 | ChatFrameEditBox:Insert(name); |
||
257 | --If control-clicked, use the dressing room |
||
258 | elseif(IsControlKeyDown() and iteminfo) then |
||
259 | DressUpItemLink(this.itemID); |
||
260 | end |
||
261 | end |
||
262 | |||
263 | -------------------------------------------------------------------------------- |
||
264 | -- Text replacement function |
||
265 | -------------------------------------------------------------------------------- |
||
266 | local function AtlasLoot_FixText(text) |
||
267 | --Armour class |
||
268 | text = gsub(text, "#a1#", ATLASLOOT_CLOTH); |
||
269 | text = gsub(text, "#a2#", ATLASLOOT_LEATHER); |
||
270 | text = gsub(text, "#a3#", ATLASLOOT_MAIL); |
||
271 | text = gsub(text, "#a4#", ATLASLOOT_PLATE); |
||
272 | |||
273 | --Body slot |
||
274 | text = gsub(text, "#s1#", ATLASLOOT_HEAD); |
||
275 | text = gsub(text, "#s2#", ATLASLOOT_NECK); |
||
276 | text = gsub(text, "#s3#", ATLASLOOT_SHOULDER); |
||
277 | text = gsub(text, "#s4#", ATLASLOOT_BACK); |
||
278 | text = gsub(text, "#s5#", ATLASLOOT_CHEST); |
||
279 | text = gsub(text, "#s6#", ATLASLOOT_SHIRT); |
||
280 | text = gsub(text, "#s7#", ATLASLOOT_TABARD); |
||
281 | text = gsub(text, "#s8#", ATLASLOOT_WRIST); |
||
282 | text = gsub(text, "#s9#", ATLASLOOT_HANDS); |
||
283 | text = gsub(text, "#s10#", ATLASLOOT_WAIST); |
||
284 | text = gsub(text, "#s11#", ATLASLOOT_LEGS); |
||
285 | text = gsub(text, "#s12#", ATLASLOOT_FEET); |
||
286 | text = gsub(text, "#s13#", ATLASLOOT_RING); |
||
287 | text = gsub(text, "#s14#", ATLASLOOT_TRINKET); |
||
288 | text = gsub(text, "#s15#", ATLASLOOT_OFF_HAND); |
||
289 | text = gsub(text, "#s16#", ATLASLOOT_RELIC); |
||
290 | |||
291 | --Weapon Weilding |
||
292 | text = gsub(text, "#h1#", ATLASLOOT_ONE_HAND); |
||
293 | text = gsub(text, "#h2#", ATLASLOOT_TWO_HAND); |
||
294 | text = gsub(text, "#h3#", ATLASLOOT_MAIN_HAND); |
||
295 | text = gsub(text, "#h4#", ATLASLOOT_OFFHAND); |
||
296 | |||
297 | --Weapon type |
||
298 | text = gsub(text, "#w1#", ATLASLOOT_AXE); |
||
299 | text = gsub(text, "#w2#", ATLASLOOT_BOW); |
||
300 | text = gsub(text, "#w3#", ATLASLOOT_CROSSBOW); |
||
301 | text = gsub(text, "#w4#", ATLASLOOT_DAGGER); |
||
302 | text = gsub(text, "#w5#", ATLASLOOT_GUN); |
||
303 | text = gsub(text, "#w6#", ATLASLOOT_MACE); |
||
304 | text = gsub(text, "#w7#", ATLASLOOT_POLEARM); |
||
305 | text = gsub(text, "#w8#", ATLASLOOT_SHIELD); |
||
306 | text = gsub(text, "#w9#", ATLASLOOT_STAFF); |
||
307 | text = gsub(text, "#w10#", ATLASLOOT_SWORD); |
||
308 | text = gsub(text, "#w11#", ATLASLOOT_THROWN); |
||
309 | text = gsub(text, "#w12#", ATLASLOOT_WAND); |
||
310 | text = gsub(text, "#w13#", ATLASLOOT_FIST); |
||
311 | |||
312 | -- Misc. Equipment |
||
313 | text = gsub(text, "#e1#", ATLASLOOT_POTION); |
||
314 | text = gsub(text, "#e2#", ATLASLOOT_FOOD); |
||
315 | text = gsub(text, "#e3#", ATLASLOOT_DRINK); |
||
316 | text = gsub(text, "#e4#", ATLASLOOT_BANDAGE); |
||
317 | text = gsub(text, "#e5#", ATLASLOOT_ARROW); |
||
318 | text = gsub(text, "#e6#", ATLASLOOT_BULLET); |
||
319 | text = gsub(text, "#e7#", ATLASLOOT_MOUNT); |
||
320 | text = gsub(text, "#e8#", ATLASLOOT_AMMO); |
||
321 | text = gsub(text, "#e9#", ATLASLOOT_QUIVER); |
||
322 | text = gsub(text, "#e10#", ATLASLOOT_BAG); |
||
323 | text = gsub(text, "#e11#", ATLASLOOT_ENCHANT); |
||
324 | text = gsub(text, "#e12#", ATLASLOOT_TRADE_GOODS); |
||
325 | text = gsub(text, "#e13#", ATLASLOOT_SCOPE); |
||
326 | text = gsub(text, "#e14#", ATLASLOOT_KEY); |
||
327 | text = gsub(text, "#e15#", ATLASLOOT_PET); |
||
328 | text = gsub(text, "#e16#", ATLASLOOT_IDOL); |
||
329 | text = gsub(text, "#e17#", ATLASLOOT_TOTEM); |
||
330 | text = gsub(text, "#e18#", ATLASLOOT_LIBRAM); |
||
331 | text = gsub(text, "#e19#", ATLASLOOT_DARKMOON); |
||
332 | text = gsub(text, "#e20#", ATLASLOOT_BOOK); |
||
333 | text = gsub(text, "#e21#", ATLASLOOT_BANNER); |
||
334 | |||
335 | -- Classes |
||
336 | text = gsub(text, "#c1#", ATLASLOOT_DRUID); |
||
337 | text = gsub(text, "#c2#", ATLASLOOT_HUNTER); |
||
338 | text = gsub(text, "#c3#", ATLASLOOT_MAGE); |
||
339 | text = gsub(text, "#c4#", ATLASLOOT_PALADIN); |
||
340 | text = gsub(text, "#c5#", ATLASLOOT_PRIEST); |
||
341 | text = gsub(text, "#c6#", ATLASLOOT_ROGUE); |
||
342 | text = gsub(text, "#c7#", ATLASLOOT_SHAMAN); |
||
343 | text = gsub(text, "#c8#", ATLASLOOT_WARLOCK); |
||
344 | text = gsub(text, "#c9#", ATLASLOOT_WARRIOR); |
||
345 | |||
346 | --Professions |
||
347 | text = gsub(text, "#p1#", ATLASLOOT_ALCHEMY); |
||
348 | text = gsub(text, "#p2#", ATLASLOOT_BLACKSMITHING); |
||
349 | text = gsub(text, "#p3#", ATLASLOOT_COOKING); |
||
350 | text = gsub(text, "#p4#", ATLASLOOT_ENCHANTING); |
||
351 | text = gsub(text, "#p5#", ATLASLOOT_ENGINEERING); |
||
352 | text = gsub(text, "#p6#", ATLASLOOT_FIRST_AID); |
||
353 | text = gsub(text, "#p7#", ATLASLOOT_LEATHERWORKING); |
||
354 | text = gsub(text, "#p8#", ATLASLOOT_TAILORING); |
||
355 | text = gsub(text, "#p9#", ATLASLOOT_DRAGONSCALE); |
||
356 | text = gsub(text, "#p10#", ATLASLOOT_TRIBAL); |
||
357 | text = gsub(text, "#p11#", ATLASLOOT_ELEMENTAL); |
||
358 | |||
359 | --Reputation |
||
360 | text = gsub(text, "#r1#", ATLASLOOT_NEUTRAL); |
||
361 | text = gsub(text, "#r2#", ATLASLOOT_FRIENDLY); |
||
362 | text = gsub(text, "#r3#", ATLASLOOT_HONORED); |
||
363 | text = gsub(text, "#r4#", ATLASLOOT_REVERED); |
||
364 | text = gsub(text, "#r5#", ATLASLOOT_EXALTED); |
||
365 | |||
366 | --Battleground Factions |
||
367 | text = gsub(text, "#b1#", ATLASLOOT_BG_STORMPIKE); |
||
368 | text = gsub(text, "#b2#", ATLASLOOT_BG_FROSTWOLF); |
||
369 | text = gsub(text, "#b3#", ATLASLOOT_BG_SENTINELS); |
||
370 | text = gsub(text, "#b4#", ATLASLOOT_BG_OUTRIDERS); |
||
371 | text = gsub(text, "#b5#", ATLASLOOT_BG_ARATHOR); |
||
372 | text = gsub(text, "#b6#", ATLASLOOT_BG_DEFILERS); |
||
373 | |||
374 | -- Misc phrases and mod specific stuff |
||
375 | text = gsub(text, "#m1#", ATLASLOOT_CLASSES); |
||
376 | text = gsub(text, "#m2#", ATLASLOOT_QUEST1); |
||
377 | text = gsub(text, "#m3#", ATLASLOOT_QUEST2); |
||
378 | text = gsub(text, "#m4#", ATLASLOOT_QUEST3); |
||
379 | text = gsub(text, "#m5#", ATLASLOOT_SHARED); |
||
380 | text = gsub(text, "#m6#", ATLASLOOT_HORDE); |
||
381 | text = gsub(text, "#m7#", ATLASLOOT_ALLIANCE); |
||
382 | text = gsub(text, "#m8#", ATLASLOOT_UNIQUE); |
||
383 | text = gsub(text, "#m9#", ATLASLOOT_RIGHTSIDE); |
||
384 | text = gsub(text, "#m10#", ATLASLOOT_LEFTSIDE); |
||
385 | text = gsub(text, "#m11#", ATLASLOOT_FELCOREBAG); |
||
386 | text = gsub(text, "#m12#", ATLASLOOT_ONYBAG); |
||
387 | text = gsub(text, "#m13#", ATLASLOOT_WCBAG); |
||
388 | text = gsub(text, "#m14#", ATLASLOOT_FULLSKILL); |
||
389 | text = gsub(text, "#m15#", ATLASLOOT_295); |
||
390 | text = gsub(text, "#m16#", ATLASLOOT_275); |
||
391 | text = gsub(text, "#m17#", ATLASLOOT_265); |
||
392 | text = gsub(text, "#m18#", ATLASLOOT_290); |
||
393 | text = gsub(text, "#m19#", ATLASLOOT_SET); |
||
394 | text = gsub(text, "#m20#", ATLASLOOT_285); |
||
395 | text = gsub(text, "#m21#", ATLASLOOT_16SLOT); |
||
396 | |||
397 | text = gsub(text, "#x1#", ATLASLOOT_COBRAHN); |
||
398 | text = gsub(text, "#x2#", ATLASLOOT_ANACONDRA); |
||
399 | text = gsub(text, "#x3#", ATLASLOOT_SERPENTIS); |
||
400 | text = gsub(text, "#x4#", ATLASLOOT_FANGDRUID); |
||
401 | text = gsub(text, "#x5#", ATLASLOOT_PYTHAS); |
||
402 | text = gsub(text, "#x6#", ATLASLOOT_VANCLEEF); |
||
403 | text = gsub(text, "#x7#", ATLASLOOT_GREENSKIN); |
||
404 | text = gsub(text, "#x8#", ATLASLOOT_DEFIASMINER); |
||
405 | text = gsub(text, "#x9#", ATLASLOOT_DEFIASOVERSEER); |
||
406 | text = gsub(text, "#x10#", ATLASLOOT_Primal_Hakkari_Kossack); |
||
407 | text = gsub(text, "#x11#", ATLASLOOT_Primal_Hakkari_Shawl); |
||
408 | text = gsub(text, "#x12#", ATLASLOOT_Primal_Hakkari_Bindings); |
||
409 | text = gsub(text, "#x13#", ATLASLOOT_Primal_Hakkari_Sash); |
||
410 | text = gsub(text, "#x14#", ATLASLOOT_Primal_Hakkari_Stanchion); |
||
411 | text = gsub(text, "#x15#", ATLASLOOT_Primal_Hakkari_Aegis); |
||
412 | text = gsub(text, "#x16#", ATLASLOOT_Primal_Hakkari_Girdle); |
||
413 | text = gsub(text, "#x17#", ATLASLOOT_Primal_Hakkari_Armsplint); |
||
414 | text = gsub(text, "#x18#", ATLASLOOT_Primal_Hakkari_Tabard); |
||
415 | text = gsub(text, "#x19#", ATLASLOOT_Qiraji_Ornate_Hilt); |
||
416 | text = gsub(text, "#x20#", ATLASLOOT_Qiraji_Martial_Drape); |
||
417 | text = gsub(text, "#x21#", ATLASLOOT_Qiraji_Magisterial_Ring); |
||
418 | text = gsub(text, "#x22#", ATLASLOOT_Qiraji_Ceremonial_Ring); |
||
419 | text = gsub(text, "#x23#", ATLASLOOT_Qiraji_Regal_Drape); |
||
420 | text = gsub(text, "#x24#", ATLASLOOT_Qiraji_Spiked_Hilt); |
||
421 | text = gsub(text, "#x25#", ATLASLOOT_Qiraji_Bindings_of_Dominance); |
||
422 | text = gsub(text, "#x26#", ATLASLOOT_Veknilashs_Circlet); |
||
423 | text = gsub(text, "#x27#", ATLASLOOT_Ouros_Intact_Hide); |
||
424 | text = gsub(text, "#x28#", ATLASLOOT_Husk_of_the_Old_God); |
||
425 | text = gsub(text, "#x29#", ATLASLOOT_Qiraji_Bindings_of_Command); |
||
426 | text = gsub(text, "#x30#", ATLASLOOT_Veklors_Diadem); |
||
427 | text = gsub(text, "#x31#", ATLASLOOT_Skin_of_the_Great_Sandworm); |
||
428 | text = gsub(text, "#x32#", ATLASLOOT_Carapace_of_the_Old_God); |
||
429 | text = gsub(text, "#x33#", ATLASLOOT_SCARLETDEFENDER); |
||
430 | text = gsub(text, "#x34#", ATLASLOOT_SCARLETTRASH); |
||
431 | text = gsub(text, "#x35#", ATLASLOOT_SCARLETCHAMPION); |
||
432 | text = gsub(text, "#x36#", ATLASLOOT_SCARLETCENTURION); |
||
433 | text = gsub(text, "#x37#", ATLASLOOT_SCARLETHEROD); |
||
434 | text = gsub(text, "#x38#", ATLASLOOT_SCARLETPROTECTOR); |
||
435 | |||
436 | --Zg Sets |
||
437 | text = gsub(text, "#zgs1#", ATLASLOOT_ZG_DRUID); |
||
438 | text = gsub(text, "#zgs2#", ATLASLOOT_ZG_HUNTER); |
||
439 | text = gsub(text, "#zgs3#", ATLASLOOT_ZG_MAGE); |
||
440 | text = gsub(text, "#zgs4#", ATLASLOOT_ZG_PALADIN); |
||
441 | text = gsub(text, "#zgs5#", ATLASLOOT_ZG_PRIEST); |
||
442 | text = gsub(text, "#zgs6#", ATLASLOOT_ZG_ROGUE); |
||
443 | text = gsub(text, "#zgs7#", ATLASLOOT_ZG_SHAMAN); |
||
444 | text = gsub(text, "#zgs8#", ATLASLOOT_ZG_WARLOCK); |
||
445 | text = gsub(text, "#zgs9#", ATLASLOOT_ZG_WARRIOR); |
||
446 | |||
447 | --aq20 Sets |
||
448 | text = gsub(text, "#aq20s1#", ATLASLOOT_AQ20_DRUID); |
||
449 | text = gsub(text, "#aq20s2#", ATLASLOOT_AQ20_HUNTER); |
||
450 | text = gsub(text, "#aq20s3#", ATLASLOOT_AQ20_MAGE); |
||
451 | text = gsub(text, "#aq20s4#", ATLASLOOT_AQ20_PALADIN); |
||
452 | text = gsub(text, "#aq20s5#", ATLASLOOT_AQ20_PRIEST); |
||
453 | text = gsub(text, "#aq20s6#", ATLASLOOT_AQ20_ROGUE); |
||
454 | text = gsub(text, "#aq20s7#", ATLASLOOT_AQ20_SHAMAN); |
||
455 | text = gsub(text, "#aq20s8#", ATLASLOOT_AQ20_WARLOCK); |
||
456 | text = gsub(text, "#aq20s9#", ATLASLOOT_AQ20_WARRIOR); |
||
457 | |||
458 | --aq40 Sets |
||
459 | text = gsub(text, "#aq40s1#", ATLASLOOT_AQ40_DRUID); |
||
460 | text = gsub(text, "#aq40s2#", ATLASLOOT_AQ40_HUNTER); |
||
461 | text = gsub(text, "#aq40s3#", ATLASLOOT_AQ40_MAGE); |
||
462 | text = gsub(text, "#aq40s4#", ATLASLOOT_AQ40_PALADIN); |
||
463 | text = gsub(text, "#aq40s5#", ATLASLOOT_AQ40_PRIEST); |
||
464 | text = gsub(text, "#aq40s6#", ATLASLOOT_AQ40_ROGUE); |
||
465 | text = gsub(text, "#aq40s7#", ATLASLOOT_AQ40_SHAMAN); |
||
466 | text = gsub(text, "#aq40s8#", ATLASLOOT_AQ40_WARLOCK); |
||
467 | text = gsub(text, "#aq40s9#", ATLASLOOT_AQ40_WARRIOR); |
||
468 | |||
469 | --T0 Sets |
||
470 | text = gsub(text, "#t0s1#", ATLASLOOT_T0_DRUID); |
||
471 | text = gsub(text, "#t0s2#", ATLASLOOT_T0_HUNTER); |
||
472 | text = gsub(text, "#t0s3#", ATLASLOOT_T0_MAGE); |
||
473 | text = gsub(text, "#t0s4#", ATLASLOOT_T0_PALADIN); |
||
474 | text = gsub(text, "#t0s5#", ATLASLOOT_T0_PRIEST); |
||
475 | text = gsub(text, "#t0s6#", ATLASLOOT_T0_ROGUE); |
||
476 | text = gsub(text, "#t0s7#", ATLASLOOT_T0_SHAMAN); |
||
477 | text = gsub(text, "#t0s8#", ATLASLOOT_T0_WARLOCK); |
||
478 | text = gsub(text, "#t0s9#", ATLASLOOT_T0_WARRIOR); |
||
479 | |||
480 | --T0.5 Sets |
||
481 | text = gsub(text, "#t05s1#", ATLASLOOT_T05_DRUID); |
||
482 | text = gsub(text, "#t05s2#", ATLASLOOT_T05_HUNTER); |
||
483 | text = gsub(text, "#t05s3#", ATLASLOOT_T05_MAGE); |
||
484 | text = gsub(text, "#t05s4#", ATLASLOOT_T05_PALADIN); |
||
485 | text = gsub(text, "#t05s5#", ATLASLOOT_T05_PRIEST); |
||
486 | text = gsub(text, "#t05s6#", ATLASLOOT_T05_ROGUE); |
||
487 | text = gsub(text, "#t05s7#", ATLASLOOT_T05_SHAMAN); |
||
488 | text = gsub(text, "#t05s8#", ATLASLOOT_T05_WARLOCK); |
||
489 | text = gsub(text, "#t05s9#", ATLASLOOT_T05_WARRIOR); |
||
490 | |||
491 | --T1 Sets |
||
492 | text = gsub(text, "#t1s1#", ATLASLOOT_T1_DRUID); |
||
493 | text = gsub(text, "#t1s2#", ATLASLOOT_T1_HUNTER); |
||
494 | text = gsub(text, "#t1s3#", ATLASLOOT_T1_MAGE); |
||
495 | text = gsub(text, "#t1s4#", ATLASLOOT_T1_PALADIN); |
||
496 | text = gsub(text, "#t1s5#", ATLASLOOT_T1_PRIEST); |
||
497 | text = gsub(text, "#t1s6#", ATLASLOOT_T1_ROGUE); |
||
498 | text = gsub(text, "#t1s7#", ATLASLOOT_T1_SHAMAN); |
||
499 | text = gsub(text, "#t1s8#", ATLASLOOT_T1_WARLOCK); |
||
500 | text = gsub(text, "#t1s9#", ATLASLOOT_T1_WARRIOR); |
||
501 | |||
502 | --T2 Sets |
||
503 | text = gsub(text, "#t2s1#", ATLASLOOT_T2_DRUID); |
||
504 | text = gsub(text, "#t2s2#", ATLASLOOT_T2_HUNTER); |
||
505 | text = gsub(text, "#t2s3#", ATLASLOOT_T2_MAGE); |
||
506 | text = gsub(text, "#t2s4#", ATLASLOOT_T2_PALADIN); |
||
507 | text = gsub(text, "#t2s5#", ATLASLOOT_T2_PRIEST); |
||
508 | text = gsub(text, "#t2s6#", ATLASLOOT_T2_ROGUE); |
||
509 | text = gsub(text, "#t2s7#", ATLASLOOT_T2_SHAMAN); |
||
510 | text = gsub(text, "#t2s8#", ATLASLOOT_T2_WARLOCK); |
||
511 | text = gsub(text, "#t2s9#", ATLASLOOT_T2_WARRIOR); |
||
512 | |||
513 | --T3 Sets |
||
514 | text = gsub(text, "#t3s1#", ATLASLOOT_T3_DRUID); |
||
515 | text = gsub(text, "#t3s2#", ATLASLOOT_T3_HUNTER); |
||
516 | text = gsub(text, "#t3s3#", ATLASLOOT_T3_MAGE); |
||
517 | text = gsub(text, "#t3s4#", ATLASLOOT_T3_PALADIN); |
||
518 | text = gsub(text, "#t3s5#", ATLASLOOT_T3_PRIEST); |
||
519 | text = gsub(text, "#t3s6#", ATLASLOOT_T3_ROGUE); |
||
520 | text = gsub(text, "#t3s7#", ATLASLOOT_T3_SHAMAN); |
||
521 | text = gsub(text, "#t3s8#", ATLASLOOT_T3_WARLOCK); |
||
522 | text = gsub(text, "#t3s9#", ATLASLOOT_T3_WARRIOR); |
||
523 | |||
524 | --PvP Epic Horde Sets |
||
525 | text = gsub(text, "#pvpeh1#", ATLASLOOT_PVP_EPIC_H_DRUID); |
||
526 | text = gsub(text, "#pvpeh2#", ATLASLOOT_PVP_EPIC_H_HUNTER); |
||
527 | text = gsub(text, "#pvpeh3#", ATLASLOOT_PVP_EPIC_H_MAGE); |
||
528 | text = gsub(text, "#pvpeh4#", ATLASLOOT_PVP_EPIC_H_PRIEST); |
||
529 | text = gsub(text, "#pvpeh5#", ATLASLOOT_PVP_EPIC_H_ROGUE); |
||
530 | text = gsub(text, "#pvpeh6#", ATLASLOOT_PVP_EPIC_H_SHAMAN); |
||
531 | text = gsub(text, "#pvpeh7#", ATLASLOOT_PVP_EPIC_H_WARLOCK); |
||
532 | text = gsub(text, "#pvpeh8#", ATLASLOOT_PVP_EPIC_H_WARRIOR); |
||
533 | |||
534 | --PvP Epic Alliance Sets |
||
535 | text = gsub(text, "#pvpea1#", ATLASLOOT_PVP_EPIC_A_DRUID); |
||
536 | text = gsub(text, "#pvpea2#", ATLASLOOT_PVP_EPIC_A_HUNTER); |
||
537 | text = gsub(text, "#pvpea3#", ATLASLOOT_PVP_EPIC_A_MAGE); |
||
538 | text = gsub(text, "#pvpea4#", ATLASLOOT_PVP_EPIC_A_PALADIN); |
||
539 | text = gsub(text, "#pvpea5#", ATLASLOOT_PVP_EPIC_A_PRIEST); |
||
540 | text = gsub(text, "#pvpea6#", ATLASLOOT_PVP_EPIC_A_ROGUE); |
||
541 | text = gsub(text, "#pvpea7#", ATLASLOOT_PVP_EPIC_A_WARLOCK); |
||
542 | text = gsub(text, "#pvpea8#", ATLASLOOT_PVP_EPIC_A_WARRIOR); |
||
543 | |||
544 | --PvP Rare Horde Sets |
||
545 | text = gsub(text, "#pvprh1#", ATLASLOOT_PVP_RARE_H_DRUID); |
||
546 | text = gsub(text, "#pvprh2#", ATLASLOOT_PVP_RARE_H_HUNTER); |
||
547 | text = gsub(text, "#pvprh3#", ATLASLOOT_PVP_RARE_H_MAGE); |
||
548 | text = gsub(text, "#pvprh4#", ATLASLOOT_PVP_RARE_H_PRIEST); |
||
549 | text = gsub(text, "#pvprh5#", ATLASLOOT_PVP_RARE_H_ROGUE); |
||
550 | text = gsub(text, "#pvprh6#", ATLASLOOT_PVP_RARE_H_SHAMAN); |
||
551 | text = gsub(text, "#pvprh7#", ATLASLOOT_PVP_RARE_H_WARLOCK); |
||
552 | text = gsub(text, "#pvprh8#", ATLASLOOT_PVP_RARE_H_WARRIOR); |
||
553 | |||
554 | --PvP Rare Alliance Sets |
||
555 | text = gsub(text, "#pvpra1#", ATLASLOOT_PVP_RARE_A_DRUID); |
||
556 | text = gsub(text, "#pvpra2#", ATLASLOOT_PVP_RARE_A_HUNTER); |
||
557 | text = gsub(text, "#pvpra3#", ATLASLOOT_PVP_RARE_A_MAGE); |
||
558 | text = gsub(text, "#pvpra4#", ATLASLOOT_PVP_RARE_A_PALADIN); |
||
559 | text = gsub(text, "#pvpra5#", ATLASLOOT_PVP_RARE_A_PRIEST); |
||
560 | text = gsub(text, "#pvpra6#", ATLASLOOT_PVP_RARE_A_ROGUE); |
||
561 | text = gsub(text, "#pvpra7#", ATLASLOOT_PVP_RARE_A_WARLOCK); |
||
562 | text = gsub(text, "#pvpra8#", ATLASLOOT_PVP_RARE_A_WARRIOR); |
||
563 | |||
564 | --Misc PvP Set Text |
||
565 | text = gsub(text, "#pvps1#", ATLASLOOT_PVP_EPIC_SET); |
||
566 | text = gsub(text, "#pvps2#", ATLASLOOT_PVP_RARE_SET); |
||
567 | |||
568 | --Text colouring |
||
569 | text = gsub(text, "=q0=", "|cff9d9d9d"); |
||
570 | text = gsub(text, "=q1=", "|cffFFFFFF"); |
||
571 | text = gsub(text, "=q2=", "|cff1eff00"); |
||
572 | text = gsub(text, "=q3=", "|cff0070dd"); |
||
573 | text = gsub(text, "=q4=", "|cffa335ee"); |
||
574 | text = gsub(text, "=q5=", "|cffFF8000"); |
||
575 | text = gsub(text, "=q6=", "|cffFF0000"); |
||
576 | text = gsub(text, "=ds=", "|cffFFd200"); |
||
577 | return text; |
||
578 | end |
||
579 | |||
580 | -------------------------------------------------------------------------------- |
||
581 | -- Hooked AtlasRefresh |
||
582 | -- Called if any change to the Atlas Frame |
||
583 | -------------------------------------------------------------------------------- |
||
584 | function AtlasLoot_Refresh() |
||
585 | if(Hooked_Atlas_Refresh) then |
||
586 | Hooked_Atlas_Refresh(); |
||
587 | --If we are dealing with instances |
||
588 | if ( AtlasOptions.AtlasType == 1 ) then |
||
589 | local zoneID = ATLAS_DROPDOWN_LIST[AtlasOptions.AtlasZone]; |
||
590 | local text; |
||
591 | --If we have atlasloot data |
||
592 | if(AtlasLootBossButtons[zoneID] ~= nil) then |
||
593 | for i = 1, 27, 1 do |
||
594 | --If we have items in the atlasloot data |
||
595 | if(AtlasLootBossButtons[zoneID][i] ~= nil and AtlasLootBossButtons[zoneID][i] ~= "") then |
||
596 | getglobal("AtlasText_"..i):Hide(); |
||
597 | getglobal("AtlasBossLine_"..i):Show(); |
||
598 | --Ridiculous number of special cases, need to to something to clean this up |
||
599 | if(getglobal("AtlasText_"..i):GetText() == nil and getglobal("AtlasText_"..i-1):GetText() == nil and getglobal("AtlasText_"..i-2):GetText() ~= nil) then |
||
600 | if(zoneID == "TheRuinsofAhnQiraj") then |
||
601 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_CLASS_BOOKS); |
||
602 | elseif(zoneID == "DireMaulNorth") then |
||
603 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_TRIBUTE_RUN); |
||
604 | elseif(zoneID == "WailingCaverns") then |
||
605 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_VIPERSET); |
||
606 | elseif(zoneID == "TheDeadmines") then |
||
607 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_DEFIASSET); |
||
608 | elseif(zoneID == "ScarletMonastery") then |
||
609 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_SCARLETSET); |
||
610 | elseif((zoneID == "DireMaulEast") or (zoneID == "DireMaulWest")) then |
||
611 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_DM_BOOKS); |
||
612 | elseif((zoneID == "BlackrockSpireUpper") or (zoneID == "BlackrockSpireLower") or (zoneID == "Scholomance")) then |
||
613 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_T0_SET_PIECES); |
||
614 | else |
||
615 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_TRASH_MOBS); |
||
616 | end |
||
617 | elseif(zoneID == "MoltenCore" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_TRASH_MOBS) then |
||
618 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_RANDOM_LOOT); |
||
619 | elseif(zoneID == "MoltenCore" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_RANDOM_LOOT and AtlasLootBossButtons[zoneID][i] == "T1SET") then |
||
620 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_MC_SET_PIECES); |
||
621 | elseif(zoneID == "BlackwingLair" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_TRASH_MOBS and AtlasLootBossButtons[zoneID][i] == "T2SET") then |
||
622 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_BWL_SET_PIECES); |
||
623 | elseif(zoneID == "TheTempleofAhnQiraj" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_TRASH_MOBS) then |
||
624 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_AQ_ENCHANTS); |
||
625 | elseif(zoneID == "TheTempleofAhnQiraj" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_AQ_ENCHANTS) then |
||
626 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_AQ40_CLASS_SET_PIECES_1); |
||
627 | elseif(zoneID == "TheRuinsofAhnQiraj" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_CLASS_BOOKS) then |
||
628 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_AQ_ENCHANTS); |
||
629 | elseif(zoneID == "TheRuinsofAhnQiraj" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_AQ_ENCHANTS) then |
||
630 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_AQ20_CLASS_SET_PIECES_1); |
||
631 | elseif((zoneID == "ZulGurub") and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_TRASH_MOBS) then |
||
632 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_RANDOM_LOOT); |
||
633 | elseif((zoneID == "ZulGurub") and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_RANDOM_LOOT) then |
||
634 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_ZG_CLASS_SET_PIECES_1); |
||
635 | elseif((zoneID == "ZulGurub") and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_ZG_CLASS_SET_PIECES_1) then |
||
636 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_ZG_ENCHANTS); |
||
637 | elseif(zoneID == "DireMaulNorth" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_TRIBUTE_RUN) then |
||
638 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_DM_BOOKS); |
||
639 | elseif(zoneID == "Naxxramas" and getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREY..ATLASLOOT_TRASH_MOBS and AtlasLootBossButtons[zoneID][i] == "T3SET") then |
||
640 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREY..ATLASLOOT_NAXX_SET_PIECES); |
||
641 | else |
||
642 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(getglobal("AtlasText_"..i):GetText()); |
||
643 | end |
||
644 | getglobal("AtlasBossLine_"..i.."_Loot"):Show(); |
||
645 | getglobal("AtlasBossLine_"..i.."_Selected"):Hide(); |
||
646 | else |
||
647 | getglobal("AtlasText_"..i):Show(); |
||
648 | getglobal("AtlasBossLine_"..i):Hide(); |
||
649 | end |
||
650 | end |
||
651 | getglobal("AtlasLootInfo"):Show(); |
||
652 | else |
||
653 | for i = 1, 27, 1 do |
||
654 | getglobal("AtlasText_"..i):Show(); |
||
655 | getglobal("AtlasBossLine_"..i):Hide(); |
||
656 | end |
||
657 | getglobal("AtlasLootInfo"):Hide(); |
||
658 | end |
||
659 | --If we are dealing with battlegrounds |
||
660 | elseif ( AtlasOptions.AtlasType == 2 ) then |
||
661 | zoneID = ATLAS_DROPDOWN_LIST_BG[AtlasOptions.AtlasZone]; |
||
662 | local text; |
||
663 | if(AtlasLootBattlegrounds[zoneID] ~= nil) then |
||
664 | --If we have data, just show the rep rewards where we set them. |
||
665 | for i = 1, 27, 1 do |
||
666 | if(AtlasLootBattlegrounds[zoneID][i] ~= nil and AtlasLootBattlegrounds[zoneID][i] ~= "") then |
||
667 | if(getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREEN..ATLASLOOT_BG_FRIENDLY) then |
||
668 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREEN..ATLASLOOT_BG_HONORED); |
||
669 | elseif(getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREEN..ATLASLOOT_BG_HONORED) then |
||
670 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREEN..ATLASLOOT_BG_REVERED); |
||
671 | elseif(getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREEN..ATLASLOOT_BG_REVERED) then |
||
672 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREEN..ATLASLOOT_BG_EXALTED); |
||
673 | elseif(getglobal("AtlasBossLine_"..(i-1).."_Text"):GetText() == GREEN..ATLASLOOT_BG_EXALTED) then |
||
674 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREEN..ATLASLOOT_PVP_SET_PIECES); |
||
675 | elseif(getglobal("AtlasText_"..i):GetText() == nil) then |
||
676 | getglobal("AtlasBossLine_"..i.."_Text"):SetText(GREEN..ATLASLOOT_BG_FRIENDLY); |
||
677 | end |
||
678 | getglobal("AtlasBossLine_"..i.."_Loot"):Show(); |
||
679 | getglobal("AtlasBossLine_"..i.."_Selected"):Hide(); |
||
680 | getglobal("AtlasText_"..i):Hide(); |
||
681 | getglobal("AtlasBossLine_"..i):Show(); |
||
682 | else |
||
683 | getglobal("AtlasText_"..i):Show(); |
||
684 | getglobal("AtlasBossLine_"..i):Hide(); |
||
685 | end |
||
686 | end |
||
687 | getglobal("AtlasLootInfo"):Show(); |
||
688 | else |
||
689 | for i = 1, 27, 1 do |
||
690 | getglobal("AtlasText_"..i):Show(); |
||
691 | getglobal("AtlasBossLine_"..i):Hide(); |
||
692 | end |
||
693 | getglobal("AtlasLootInfo"):Hide(); |
||
694 | end |
||
695 | else |
||
696 | for i = 1, 27, 1 do |
||
697 | getglobal("AtlasText_"..i):Show(); |
||
698 | getglobal("AtlasBossLine_"..i):Hide(); |
||
699 | end |
||
700 | getglobal("AtlasLootInfo"):Hide(); |
||
701 | end |
||
702 | AtlasLootItemsFrame:Hide(); |
||
703 | end |
||
704 | end |
||
705 | |||
706 | function AtlasLoot_SetMenu(setname) |
||
707 | if(setname=="AQ40SET") then |
||
708 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
709 | getglobal("AtlasLootItemsFrame_Druid").lootpage="AQ40Druid"; |
||
710 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
711 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="AQ40Hunter"; |
||
712 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
713 | getglobal("AtlasLootItemsFrame_Mage").lootpage="AQ40Mage"; |
||
714 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
715 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="AQ40Paladin"; |
||
716 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
717 | getglobal("AtlasLootItemsFrame_Priest").lootpage="AQ40Priest"; |
||
718 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
719 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="AQ40Rogue"; |
||
720 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
721 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="AQ40Shaman"; |
||
722 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
723 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="AQ40Warlock"; |
||
724 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
725 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="AQ40Warrior"; |
||
726 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
727 | getglobal("AtlasLootItemsFrame_BACK").setname="AQ40SET"; |
||
728 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_AQ40_SETS); |
||
729 | AtlasLootItemsFrame:Show(); |
||
730 | elseif(setname=="AQ20SET") then |
||
731 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
732 | getglobal("AtlasLootItemsFrame_Druid").lootpage="AQ20Druid"; |
||
733 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
734 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="AQ20Hunter"; |
||
735 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
736 | getglobal("AtlasLootItemsFrame_Mage").lootpage="AQ20Mage"; |
||
737 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
738 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="AQ20Paladin"; |
||
739 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
740 | getglobal("AtlasLootItemsFrame_Priest").lootpage="AQ20Priest"; |
||
741 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
742 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="AQ20Rogue"; |
||
743 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
744 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="AQ20Shaman"; |
||
745 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
746 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="AQ20Warlock"; |
||
747 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
748 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="AQ20Warrior"; |
||
749 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
750 | getglobal("AtlasLootItemsFrame_BACK").setname="AQ20SET"; |
||
751 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_AQ20_SETS); |
||
752 | AtlasLootItemsFrame:Show(); |
||
753 | elseif(setname=="ZGSET") then |
||
754 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
755 | getglobal("AtlasLootItemsFrame_Druid").lootpage="ZGDruid"; |
||
756 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
757 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="ZGHunter"; |
||
758 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
759 | getglobal("AtlasLootItemsFrame_Mage").lootpage="ZGMage"; |
||
760 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
761 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="ZGPaladin"; |
||
762 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
763 | getglobal("AtlasLootItemsFrame_Priest").lootpage="ZGPriest"; |
||
764 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
765 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="ZGRogue"; |
||
766 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
767 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="ZGShaman"; |
||
768 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
769 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="ZGWarlock"; |
||
770 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
771 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="ZGWarrior"; |
||
772 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
773 | getglobal("AtlasLootItemsFrame_BACK").setname="ZGSET"; |
||
774 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_ZG_SETS); |
||
775 | AtlasLootItemsFrame:Show(); |
||
776 | elseif(setname=="T3SET") then |
||
777 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
778 | getglobal("AtlasLootItemsFrame_Druid").lootpage="T3Druid"; |
||
779 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
780 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="T3Hunter"; |
||
781 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
782 | getglobal("AtlasLootItemsFrame_Mage").lootpage="T3Mage"; |
||
783 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
784 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="T3Paladin"; |
||
785 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
786 | getglobal("AtlasLootItemsFrame_Priest").lootpage="T3Priest"; |
||
787 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
788 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="T3Rogue"; |
||
789 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
790 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="T3Shaman"; |
||
791 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
792 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="T3Warlock"; |
||
793 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
794 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="T3Warrior"; |
||
795 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
796 | getglobal("AtlasLootItemsFrame_BACK").setname="T3SET"; |
||
797 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_TIER3_SETS); |
||
798 | AtlasLootItemsFrame:Show(); |
||
799 | elseif(setname=="T2SET") then |
||
800 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
801 | getglobal("AtlasLootItemsFrame_Druid").lootpage="T2Druid"; |
||
802 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
803 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="T2Hunter"; |
||
804 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
805 | getglobal("AtlasLootItemsFrame_Mage").lootpage="T2Mage"; |
||
806 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
807 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="T2Paladin"; |
||
808 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
809 | getglobal("AtlasLootItemsFrame_Priest").lootpage="T2Priest"; |
||
810 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
811 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="T2Rogue"; |
||
812 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
813 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="T2Shaman"; |
||
814 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
815 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="T2Warlock"; |
||
816 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
817 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="T2Warrior"; |
||
818 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
819 | getglobal("AtlasLootItemsFrame_BACK").setname="T2SET"; |
||
820 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_TIER2_SETS); |
||
821 | AtlasLootItemsFrame:Show(); |
||
822 | elseif(setname=="T1SET") then |
||
823 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
824 | getglobal("AtlasLootItemsFrame_Druid").lootpage="T1Druid"; |
||
825 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
826 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="T1Hunter"; |
||
827 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
828 | getglobal("AtlasLootItemsFrame_Mage").lootpage="T1Mage"; |
||
829 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
830 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="T1Paladin"; |
||
831 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
832 | getglobal("AtlasLootItemsFrame_Priest").lootpage="T1Priest"; |
||
833 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
834 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="T1Rogue"; |
||
835 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
836 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="T1Shaman"; |
||
837 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
838 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="T1Warlock"; |
||
839 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
840 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="T1Warrior"; |
||
841 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
842 | getglobal("AtlasLootItemsFrame_BACK").setname="T1SET"; |
||
843 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_TIER1_SETS); |
||
844 | AtlasLootItemsFrame:Show(); |
||
845 | elseif(setname=="T0SET") then |
||
846 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
847 | getglobal("AtlasLootItemsFrame_Druid").lootpage="T0Druid"; |
||
848 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
849 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="T0Hunter"; |
||
850 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
851 | getglobal("AtlasLootItemsFrame_Mage").lootpage="T0Mage"; |
||
852 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
853 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="T0Paladin"; |
||
854 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
855 | getglobal("AtlasLootItemsFrame_Priest").lootpage="T0Priest"; |
||
856 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
857 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="T0Rogue"; |
||
858 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
859 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="T0Shaman"; |
||
860 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
861 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="T0Warlock"; |
||
862 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
863 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="T0Warrior"; |
||
864 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
865 | getglobal("AtlasLootItemsFrame_BACK").setname="T0SET"; |
||
866 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_TIER0_SETS); |
||
867 | AtlasLootItemsFrame:Show(); |
||
868 | elseif(setname=="PVPSET") then |
||
869 | getglobal("AtlasLootItemsFrame_Druid"):Show(); |
||
870 | getglobal("AtlasLootItemsFrame_Druid").lootpage="PVPDruid"; |
||
871 | getglobal("AtlasLootItemsFrame_Hunter"):Show(); |
||
872 | getglobal("AtlasLootItemsFrame_Hunter").lootpage="PVPHunter"; |
||
873 | getglobal("AtlasLootItemsFrame_Mage"):Show(); |
||
874 | getglobal("AtlasLootItemsFrame_Mage").lootpage="PVPMage"; |
||
875 | getglobal("AtlasLootItemsFrame_Paladin"):Show(); |
||
876 | getglobal("AtlasLootItemsFrame_Paladin").lootpage="PVPPaladin"; |
||
877 | getglobal("AtlasLootItemsFrame_Priest"):Show(); |
||
878 | getglobal("AtlasLootItemsFrame_Priest").lootpage="PVPPriest"; |
||
879 | getglobal("AtlasLootItemsFrame_Rogue"):Show(); |
||
880 | getglobal("AtlasLootItemsFrame_Rogue").lootpage="PVPRogue"; |
||
881 | getglobal("AtlasLootItemsFrame_Shaman"):Show(); |
||
882 | getglobal("AtlasLootItemsFrame_Shaman").lootpage="PVPShaman"; |
||
883 | getglobal("AtlasLootItemsFrame_Warlock"):Show(); |
||
884 | getglobal("AtlasLootItemsFrame_Warlock").lootpage="PVPWarlock"; |
||
885 | getglobal("AtlasLootItemsFrame_Warrior"):Show(); |
||
886 | getglobal("AtlasLootItemsFrame_Warrior").lootpage="PVPWarrior"; |
||
887 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
888 | getglobal("AtlasLootItemsFrame_BACK").setname="PVPSET"; |
||
889 | AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_PVP_SET_PIECES_HEADER); |
||
890 | AtlasLootItemsFrame:Show(); |
||
891 | end |
||
892 | for i=1, 30, 1 do |
||
893 | getglobal("AtlasLootItem_"..i):Hide(); |
||
894 | end |
||
895 | end |
||
896 | |||
897 | -------------------------------------------------------------------------------- |
||
898 | -- Deal with items sets |
||
899 | -------------------------------------------------------------------------------- |
||
900 | function AtlasLoot_Set(setname) |
||
901 | if(setname~=nil) then |
||
902 | AtlasLoot_SetMenu(setname); |
||
903 | elseif(this:GetName()=="AtlasLootItemsFrame_BACK") then |
||
904 | AtlasLoot_SetMenu(this.setname); |
||
905 | else |
||
906 | getglobal("AtlasLootItemsFrame_Druid"):Hide(); |
||
907 | getglobal("AtlasLootItemsFrame_Hunter"):Hide(); |
||
908 | getglobal("AtlasLootItemsFrame_Mage"):Hide(); |
||
909 | getglobal("AtlasLootItemsFrame_Paladin"):Hide(); |
||
910 | getglobal("AtlasLootItemsFrame_Priest"):Hide(); |
||
911 | getglobal("AtlasLootItemsFrame_Rogue"):Hide(); |
||
912 | getglobal("AtlasLootItemsFrame_Shaman"):Hide(); |
||
913 | getglobal("AtlasLootItemsFrame_Warlock"):Hide(); |
||
914 | getglobal("AtlasLootItemsFrame_Warrior"):Hide(); |
||
915 | if(getglobal("AtlasLootItemsFrame_BACK").setname=="AQ40SET") then |
||
916 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
917 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="AQ20SET") then |
||
918 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
919 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="ZGSET") then |
||
920 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
921 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="T3SET") then |
||
922 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
923 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="T2SET") then |
||
924 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
925 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="T1SET") then |
||
926 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
927 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="T0SET") then |
||
928 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
929 | elseif(getglobal("AtlasLootItemsFrame_BACK").setname=="PVPSET") then |
||
930 | AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootBGItems, this:GetText(), AtlasLoot_AnchorFrame); |
||
931 | end |
||
932 | getglobal("AtlasLootItemsFrame_BACK"):Show(); |
||
933 | end |
||
934 | end |
||
935 | |||
936 | -------------------------------------------------------------------------------- |
||
937 | -- Click on boss line |
||
938 | -------------------------------------------------------------------------------- |
||
939 | function AtlasLootBoss_OnClick(id) |
||
940 | AtlasLootItemsFrame:Hide(); |
||
941 | AtlasLootItemsFrame.externalBoss = nil; |
||
942 | AtlasLoot_AnchorFrame = AtlasFrame; -- Added |
||
943 | |||
944 | if ( ( AtlasLootItemsFrame.activeBoss ) and ( AtlasLootItemsFrame.activeBoss == id ) ) then |
||
945 | AtlasLootItemsFrame.activeBoss = nil; |
||
946 | getglobal("AtlasBossLine_"..id.."_Loot"):Show(); |
||
947 | getglobal("AtlasBossLine_"..id.."_Selected"):Hide(); |
||
948 | else |
||
949 | AtlasLootItemsFrame.activeBoss = id; |
||
950 | |||
951 | for i = 1, 27, 1 do |
||
952 | getglobal("AtlasBossLine_"..i.."_Loot"):Show(); |
||
953 | getglobal("AtlasBossLine_"..i.."_Selected"):Hide(); |
||
954 | end |
||
955 | |||
956 | local _,_,boss = string.find(getglobal("AtlasBossLine_"..id.."_Text"):GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX]*[%) ]*(.*[^%,])[%,]?$"); |
||
957 | |||
958 | if ( AtlasOptions.AtlasType == 1 ) then |
||
959 | local zoneID = ATLAS_DROPDOWN_LIST[AtlasOptions.AtlasZone]; |
||
960 | local dataID = AtlasLootBossButtons[zoneID][id]; |
||
961 | AtlasLoot_ShowItemsFrame(dataID, AtlasLootItems, "|cffFFd200Boss: |cffFFFFFF"..boss); |
||
962 | |||
963 | elseif( AtlasOptions.AtlasType == 2 ) then |
||
964 | zoneID = ATLAS_DROPDOWN_LIST_BG[AtlasOptions.AtlasZone]; |
||
965 | local dataID = AtlasLootBattlegrounds[zoneID][id]; |
||
966 | AtlasLoot_ShowItemsFrame(dataID, AtlasLootBGItems, "|cffFFFFFF"..boss); |
||
967 | end |
||
968 | |||
969 | getglobal("AtlasBossLine_"..id.."_Loot"):Hide(); |
||
970 | getglobal("AtlasBossLine_"..id.."_Selected"):Show(); |
||
971 | |||
972 | AtlasLoot_SetItemInfoFrame(); |
||
973 | end |
||
974 | end |
||
975 | |||
976 | ------------------------------------------------------------------------------------------------------------------- |
||
977 | -- Code below placed in own function to allow calls from external sources as well as from AtlasLootBoss_OnClick(id) |
||
978 | -- The function now accepts : |
||
979 | -- 1.) the internal lootid that is basically the key for a 'Boss' |
||
980 | -- 2.) the AtlasLoot data array that should be examined for information on the 'Boss' |
||
981 | -- 3.) the name of the 'Boss' to be displayed at the top of the AtlasLootItemsFrame |
||
982 | -- 4.) a data structure detailing the frame to which the AtlasLootItemsFrame should be attached, and how it should |
||
983 | -- be anchored. This argument can be ommitted, and the default AtlasFrame will be used. |
||
984 | -- This approach is currently dependant on the data structures being identical for BattleGrounds and Instances, and whatever |
||
985 | -- new data stores are added in the future. If new or different data structures are added in any new categories |
||
986 | -- such as Exteranl Raid Bosses, then the code below should be changed to make sure it can handle that data also. |
||
987 | ------------------------------------------------------------------------------------------------------------------- |
||
988 | function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) |
||
989 | |||
990 | local itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture, itemColor; |
||
991 | local iconFrame, nameFrame, extraFrame; |
||
992 | local text, extra; |
||
993 | |||
994 | if(dataID=="AQ40SET") then |
||
995 | AtlasLoot_Set("AQ40SET"); |
||
996 | elseif(dataID=="AQ20SET") then |
||
997 | AtlasLoot_Set("AQ20SET"); |
||
998 | elseif(dataID=="ZGSET") then |
||
999 | AtlasLoot_Set("ZGSET"); |
||
1000 | elseif(dataID=="T3SET") then |
||
1001 | AtlasLoot_Set("T3SET"); |
||
1002 | elseif(dataID=="T2SET") then |
||
1003 | AtlasLoot_Set("T2SET"); |
||
1004 | elseif(dataID=="T1SET") then |
||
1005 | AtlasLoot_Set("T1SET"); |
||
1006 | elseif(dataID=="T0SET") then |
||
1007 | AtlasLoot_Set("T0SET"); |
||
1008 | elseif(dataID=="PVPSET") then |
||
1009 | AtlasLoot_Set("PVPSET"); |
||
1010 | else |
||
1011 | for i = 1, 30, 1 do |
||
1012 | if(dataSource[dataID][i] ~= nil and dataSource[dataID][i][3] ~= "") then |
||
1013 | itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(dataSource[dataID][i][1]); |
||
1014 | if(GetItemInfo(dataSource[dataID][i][1])) then |
||
1015 | _, _, _, itemColor = GetItemQualityColor(itemQuality); |
||
1016 | text = itemColor..itemName; |
||
1017 | else |
||
1018 | text = dataSource[dataID][i][3]; |
||
1019 | text = AtlasLoot_FixText(text); |
||
1020 | end |
||
1021 | |||
1022 | extra = dataSource[dataID][i][4]; |
||
1023 | extra = AtlasLoot_FixText(extra); |
||
1024 | if((not GetItemInfo(dataSource[dataID][i][1])) and (dataSource[dataID][i][1] ~= 0)) then |
||
1025 | extra = extra..ATLASLOOT_NO_ITEMINFO; |
||
1026 | end |
||
1027 | |||
1028 | iconFrame = getglobal("AtlasLootItem_"..i.."_Icon"); |
||
1029 | nameFrame = getglobal("AtlasLootItem_"..i.."_Name"); |
||
1030 | extraFrame = getglobal("AtlasLootItem_"..i.."_Extra"); |
||
1031 | |||
1032 | iconFrame:SetTexture("Interface\\Icons\\"..dataSource[dataID][i][2]); |
||
1033 | nameFrame:SetText(text); |
||
1034 | extraFrame:SetText(extra); |
||
1035 | |||
1036 | getglobal("AtlasLootItem_"..i).itemID = dataSource[dataID][i][1]; |
||
1037 | getglobal("AtlasLootItem_"..i).storeID = dataSource[dataID][i][1]; |
||
1038 | getglobal("AtlasLootItem_"..i).droprate = dataSource[dataID][i][5]; |
||
1039 | getglobal("AtlasLootItem_"..i).i = 1; |
||
1040 | getglobal("AtlasLootItem_"..i):Show(); |
||
1041 | else |
||
1042 | getglobal("AtlasLootItem_"..i):Hide(); |
||
1043 | end |
||
1044 | end |
||
1045 | getglobal("AtlasLootItemsFrame_Druid"):Hide(); |
||
1046 | getglobal("AtlasLootItemsFrame_Hunter"):Hide(); |
||
1047 | getglobal("AtlasLootItemsFrame_Mage"):Hide(); |
||
1048 | getglobal("AtlasLootItemsFrame_Paladin"):Hide(); |
||
1049 | getglobal("AtlasLootItemsFrame_Priest"):Hide(); |
||
1050 | getglobal("AtlasLootItemsFrame_Rogue"):Hide(); |
||
1051 | getglobal("AtlasLootItemsFrame_Shaman"):Hide(); |
||
1052 | getglobal("AtlasLootItemsFrame_Warlock"):Hide(); |
||
1053 | getglobal("AtlasLootItemsFrame_Warrior"):Hide(); |
||
1054 | getglobal("AtlasLootItemsFrame_BACK"):Hide(); |
||
1055 | AtlasLoot_BossName:SetText(boss); |
||
1056 | end |
||
1057 | AtlasLoot_SetItemInfoFrame(pFrame); -- New function to Show the frame, dependant on which frame you want to attach it to |
||
1058 | -- pFrame can be a 'nil' value, and the AtlasFrame will be used by default |
||
1059 | end |
||
1060 | |||
1061 | -------------------------------------------------------------------------------- |
||
1062 | -- Code to deal with External Requests to display the Loot Info frame |
||
1063 | -------------------------------------------------------------------------------- |
||
1064 | |||
1065 | function AtlasLoot_ShowBossLoot(dataID, boss, pFrame) |
||
1066 | |||
1067 | AtlasLootItemsFrame:Hide(); |
||
1068 | if ( AtlasLootItemsFrame.activeBoss ) then |
||
1069 | getglobal("AtlasBossLine_"..AtlasLootItemsFrame.activeBoss.."_Loot"):Show(); |
||
1070 | getglobal("AtlasBossLine_"..AtlasLootItemsFrame.activeBoss.."_Selected"):Hide(); |
||
1071 | AtlasLootItemsFrame.activeBoss = nil; |
||
1072 | end |
||
1073 | |||
1074 | if ( dataID == AtlasLootItemsFrame.externalBoss ) then |
||
1075 | AtlasLootItemsFrame.externalBoss = nil; |
||
1076 | |||
1077 | else |
||
1078 | |||
1079 | -- The approach below is dependant on 'boss' IDs being Globally Unique |
||
1080 | -- i.e. the same 'boss' ID can not be used in both the Instance data and the BG data |
||
1081 | -- if it is, then this code will only ever fetch the BG data |
||
1082 | |||
1083 | local dataSource = AtlasLootItems; -- Instance data used as default |
||
1084 | |||
1085 | if ( AtlasLootBGItems[dataID] ) then -- but replace with BG data if 'boss' found there |
||
1086 | dataSource = AtlasLootBGItems; |
||
1087 | |||
1088 | -- ------------ elseif ( item exists in any new arrays added in the future such as External Raid Bosses ) then ...... |
||
1089 | |||
1090 | end |
||
1091 | |||
1092 | AtlasLoot_AnchorFrame = pFrame; -- Added |
||
1093 | AtlasLootItemsFrame.externalBoss = dataID; |
||
1094 | AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame); |
||
1095 | end |
||
1096 | |||
1097 | end |
||
1098 | |||
1099 | -------------------------------------------------------------------------------- |
||
1100 | -- Options |
||
1101 | -------------------------------------------------------------------------------- |
||
1102 | function AtlasLootOptions_Init() |
||
1103 | --Initialise all the check boxes on the options frame |
||
1104 | AtlasLootOptionsFrameSafeLinks:SetChecked(AtlasLootOptions.SafeLinks); |
||
1105 | AtlasLootOptionsFrameAllLinks:SetChecked(AtlasLootOptions.AllLinks); |
||
1106 | AtlasLootOptionsFrameDefaultTT:SetChecked(AtlasLootOptions.DefaultTT); |
||
1107 | AtlasLootOptionsFrameLootlinkTT:SetChecked(AtlasLootOptions.LootlinkTT); |
||
1108 | AtlasLootOptionsFrameItemSyncTT:SetChecked(AtlasLootOptions.ItemSyncTT); |
||
1109 | AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLootOptions.EquipCompare); |
||
1110 | end |
||
1111 | |||
1112 | function AtlasLootOptions_OnLoad() |
||
1113 | --Disable checkboxes of missing addons |
||
1114 | if( not LootLink_SetTooltip ) then |
||
1115 | AtlasLootOptionsFrameLootlinkTT:Disable(); |
||
1116 | AtlasLootOptionsFrameLootlinkTTText:SetText(ATLASLOOT_OPTIONS_LOOTLINK_TOOLTIPS_DISABLED); |
||
1117 | end |
||
1118 | if( not ISYNC_VERSION ) then |
||
1119 | AtlasLootOptionsFrameItemSyncTT:Disable(); |
||
1120 | AtlasLootOptionsFrameItemSyncTTText:SetText(ATLASLOOT_OPTIONS_ITEMSYNC_TOOLTIPS_DISABLED); |
||
1121 | end |
||
1122 | if( not EquipCompare_RegisterTooltip ) then |
||
1123 | AtlasLootOptionsFrameEquipCompare:Disable(); |
||
1124 | AtlasLootOptionsFrameEquipCompareText:SetText(ATLASLOOT_OPTIONS_EQUIPCOMPARE_DISABLED); |
||
1125 | end |
||
1126 | AtlasLootOptions_Init(); |
||
1127 | temp=AtlasLootOptions.SafeLinks; |
||
1128 | UIPanelWindows['AtlasLootOptionsFrame'] = {area = 'center', pushable = 0}; |
||
1129 | end |
||
1130 | |||
1131 | --Functions for toggling options check boxes. |
||
1132 | function AtlasLootOptions_SafeLinksToggle() |
||
1133 | if(AtlasLootOptions.SafeLinks) then |
||
1134 | AtlasLootOptions.SafeLinks = false; |
||
1135 | else |
||
1136 | AtlasLootOptions.SafeLinks = true; |
||
1137 | AtlasLootOptions.AllLinks = false; |
||
1138 | end |
||
1139 | AtlasLootOptions_Init(); |
||
1140 | end |
||
1141 | |||
1142 | function AtlasLootOptions_AllLinksToggle() |
||
1143 | if(AtlasLootOptions.AllLinks) then |
||
1144 | AtlasLootOptions.AllLinks = false; |
||
1145 | else |
||
1146 | AtlasLootOptions.AllLinks = true; |
||
1147 | AtlasLootOptions.SafeLinks = false; |
||
1148 | end |
||
1149 | AtlasLootOptions_Init(); |
||
1150 | end |
||
1151 | |||
1152 | function AtlasLootOptions_DefaultTTToggle() |
||
1153 | AtlasLootOptions.DefaultTT = true; |
||
1154 | AtlasLootOptions.LootlinkTT = false; |
||
1155 | AtlasLootOptions.ItemSyncTT = false; |
||
1156 | AtlasLootOptions_Init(); |
||
1157 | end |
||
1158 | |||
1159 | function AtlasLootOptions_LootlinkTTToggle() |
||
1160 | AtlasLootOptions.DefaultTT = false; |
||
1161 | AtlasLootOptions.LootlinkTT = true; |
||
1162 | AtlasLootOptions.ItemSyncTT = false; |
||
1163 | AtlasLootOptions_Init(); |
||
1164 | end |
||
1165 | |||
1166 | function AtlasLootOptions_ItemSyncTTToggle() |
||
1167 | AtlasLootOptions.DefaultTT = false; |
||
1168 | AtlasLootOptions.LootlinkTT = false; |
||
1169 | AtlasLootOptions.ItemSyncTT = true; |
||
1170 | AtlasLootOptions_Init(); |
||
1171 | end |
||
1172 | |||
1173 | function AtlasLootOptions_EquipCompareToggle() |
||
1174 | if(AtlasLootOptions.EquipCompare) then |
||
1175 | AtlasLootOptions.EquipCompare = false; |
||
1176 | EquipCompare_UnregisterTooltip(AtlasLootTooltip); |
||
1177 | else |
||
1178 | AtlasLootOptions.EquipCompare = true; |
||
1179 | EquipCompare_RegisterTooltip(AtlasLootTooltip); |
||
1180 | end |
||
1181 | AtlasLootOptions_Init(); |
||
1182 | end |
||
1183 | |||
1184 | -------------------------------------------------------------------------------- |
||
1185 | -- Setup Atlas Dependant XML Components |
||
1186 | -------------------------------------------------------------------------------- |
||
1187 | |||
1188 | function AtlasLoot_SetupForAtlas() |
||
1189 | |||
1190 | AtlasLootBossLinesFrame:ClearAllPoints(); |
||
1191 | AtlasLootBossLinesFrame:SetParent(AtlasFrame); |
||
1192 | AtlasLootBossLinesFrame:SetPoint("TOPLEFT", "AtlasText_ZoneName", "TOPLEFT", 0, -80); |
||
1193 | |||
1194 | for i=1, ATLAS_LOOT_BOSS_LINES, 1 do |
||
1195 | getglobal("AtlasBossLine_"..i):ClearAllPoints(); |
||
1196 | local anchorTo = "AtlasText_"..i; |
||
1197 | getglobal("AtlasBossLine_"..i):SetPoint("TOPLEFT", anchorTo, "TOPLEFT", 0, 0); |
||
1198 | end |
||
1199 | |||
1200 | AtlasLootInfo:ClearAllPoints(); |
||
1201 | AtlasLootInfo:SetParent(AtlasFrame); |
||
1202 | AtlasLootInfo:SetPoint("TOPLEFT", "AtlasFrame", "TOPLEFT", 546, -50); |
||
1203 | |||
1204 | AtlasLoot_SetItemInfoFrame(); |
||
1205 | AtlasLootItemsFrame:Hide(); |
||
1206 | |||
1207 | end |
||
1208 | |||
1209 | function AtlasLoot_SetItemInfoFrame(pFrame) |
||
1210 | if ( pFrame ) then |
||
1211 | if(pFrame==AtlasFrame and AtlasFrame) then |
||
1212 | AtlasLootItemsFrame:ClearAllPoints(); |
||
1213 | AtlasLootItemsFrame:SetParent(AtlasFrame); |
||
1214 | AtlasLootItemsFrame:SetPoint("TOPLEFT", "AtlasFrame", "TOPLEFT", 18, -84); |
||
1215 | else |
||
1216 | AtlasLootItemsFrame:ClearAllPoints(); |
||
1217 | AtlasLootItemsFrame:SetParent(pFrame[2]); |
||
1218 | AtlasLootItemsFrame:ClearAllPoints(); |
||
1219 | AtlasLootItemsFrame:SetPoint(pFrame[1], pFrame[2], pFrame[3], pFrame[4], pFrame[5]); |
||
1220 | end |
||
1221 | elseif ( AtlasFrame ) then |
||
1222 | AtlasLootItemsFrame:ClearAllPoints(); |
||
1223 | AtlasLootItemsFrame:SetParent(AtlasFrame); |
||
1224 | AtlasLootItemsFrame:SetPoint("TOPLEFT", "AtlasFrame", "TOPLEFT", 18, -84); |
||
1225 | else |
||
1226 | AtlasLootItemsFrame:ClearAllPoints(); |
||
1227 | AtlasLootItemsFrame:SetParent(UIParent); |
||
1228 | AtlasLootItemsFrame:SetPoint("CENTER", "UIParent", "CENTER", 0, 0); |
||
1229 | end |
||
1230 | AtlasLootItemsFrame:Show(); |
||
1231 | end |