vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 MetaMapBLTData = {};
2 MetaMapBLT_ClassSet = "";
3 MetaMapBLT_ClassName = "";
4  
5 local function MetaMapBLT_FixText(text)
6 --Armour class
7 text = gsub(text, "#a1#", ATLASLOOT_CLOTH);
8 text = gsub(text, "#a2#", ATLASLOOT_LEATHER);
9 text = gsub(text, "#a3#", ATLASLOOT_MAIL);
10 text = gsub(text, "#a4#", ATLASLOOT_PLATE);
11  
12 --Body slot
13 text = gsub(text, "#s1#", ATLASLOOT_HEAD);
14 text = gsub(text, "#s2#", ATLASLOOT_NECK);
15 text = gsub(text, "#s3#", ATLASLOOT_SHOULDER);
16 text = gsub(text, "#s4#", ATLASLOOT_BACK);
17 text = gsub(text, "#s5#", ATLASLOOT_CHEST);
18 text = gsub(text, "#s6#", ATLASLOOT_SHIRT);
19 text = gsub(text, "#s7#", ATLASLOOT_TABARD);
20 text = gsub(text, "#s8#", ATLASLOOT_WRIST);
21 text = gsub(text, "#s9#", ATLASLOOT_HANDS);
22 text = gsub(text, "#s10#", ATLASLOOT_WAIST);
23 text = gsub(text, "#s11#", ATLASLOOT_LEGS);
24 text = gsub(text, "#s12#", ATLASLOOT_FEET);
25 text = gsub(text, "#s13#", ATLASLOOT_RING);
26 text = gsub(text, "#s14#", ATLASLOOT_TRINKET);
27 text = gsub(text, "#s15#", ATLASLOOT_OFF_HAND);
28 text = gsub(text, "#s16#", ATLASLOOT_RELIC);
29  
30 --Weapon Weilding
31 text = gsub(text, "#h1#", ATLASLOOT_ONE_HAND);
32 text = gsub(text, "#h2#", ATLASLOOT_TWO_HAND);
33 text = gsub(text, "#h3#", ATLASLOOT_MAIN_HAND);
34 text = gsub(text, "#h4#", ATLASLOOT_OFFHAND);
35  
36 --Weapon type
37 text = gsub(text, "#w1#", ATLASLOOT_AXE);
38 text = gsub(text, "#w2#", ATLASLOOT_BOW);
39 text = gsub(text, "#w3#", ATLASLOOT_CROSSBOW);
40 text = gsub(text, "#w4#", ATLASLOOT_DAGGER);
41 text = gsub(text, "#w5#", ATLASLOOT_GUN);
42 text = gsub(text, "#w6#", ATLASLOOT_MACE);
43 text = gsub(text, "#w7#", ATLASLOOT_POLEARM);
44 text = gsub(text, "#w8#", ATLASLOOT_SHIELD);
45 text = gsub(text, "#w9#", ATLASLOOT_STAFF);
46 text = gsub(text, "#w10#", ATLASLOOT_SWORD);
47 text = gsub(text, "#w11#", ATLASLOOT_THROWN);
48 text = gsub(text, "#w12#", ATLASLOOT_WAND);
49 text = gsub(text, "#w13#", ATLASLOOT_FIST);
50  
51 -- Misc. Equipment
52 text = gsub(text, "#e1#", ATLASLOOT_POTION);
53 text = gsub(text, "#e2#", ATLASLOOT_FOOD);
54 text = gsub(text, "#e3#", ATLASLOOT_DRINK);
55 text = gsub(text, "#e4#", ATLASLOOT_BANDAGE);
56 text = gsub(text, "#e5#", ATLASLOOT_ARROW);
57 text = gsub(text, "#e6#", ATLASLOOT_BULLET);
58 text = gsub(text, "#e7#", ATLASLOOT_MOUNT);
59 text = gsub(text, "#e8#", ATLASLOOT_AMMO);
60 text = gsub(text, "#e9#", ATLASLOOT_QUIVER);
61 text = gsub(text, "#e10#", ATLASLOOT_BAG);
62 text = gsub(text, "#e11#", ATLASLOOT_ENCHANT);
63 text = gsub(text, "#e12#", ATLASLOOT_TRADE_GOODS);
64 text = gsub(text, "#e13#", ATLASLOOT_SCOPE);
65 text = gsub(text, "#e14#", ATLASLOOT_KEY);
66 text = gsub(text, "#e15#", ATLASLOOT_PET);
67 text = gsub(text, "#e16#", ATLASLOOT_IDOL);
68 text = gsub(text, "#e17#", ATLASLOOT_TOTEM);
69 text = gsub(text, "#e18#", ATLASLOOT_LIBRAM);
70 text = gsub(text, "#e19#", ATLASLOOT_DARKMOON);
71 text = gsub(text, "#e20#", ATLASLOOT_BOOK);
72 text = gsub(text, "#e21#", ATLASLOOT_BANNER);
73  
74 -- Classes
75 text = gsub(text, "#c1#", ATLASLOOT_DRUID);
76 text = gsub(text, "#c2#", ATLASLOOT_HUNTER);
77 text = gsub(text, "#c3#", ATLASLOOT_MAGE);
78 text = gsub(text, "#c4#", ATLASLOOT_PALADIN);
79 text = gsub(text, "#c5#", ATLASLOOT_PRIEST);
80 text = gsub(text, "#c6#", ATLASLOOT_ROGUE);
81 text = gsub(text, "#c7#", ATLASLOOT_SHAMAN);
82 text = gsub(text, "#c8#", ATLASLOOT_WARLOCK);
83 text = gsub(text, "#c9#", ATLASLOOT_WARRIOR);
84  
85 --Professions
86 text = gsub(text, "#p1#", ATLASLOOT_ALCHEMY);
87 text = gsub(text, "#p2#", ATLASLOOT_BLACKSMITHING);
88 text = gsub(text, "#p3#", ATLASLOOT_COOKING);
89 text = gsub(text, "#p4#", ATLASLOOT_ENCHANTING);
90 text = gsub(text, "#p5#", ATLASLOOT_ENGINEERING);
91 text = gsub(text, "#p6#", ATLASLOOT_FIRST_AID);
92 text = gsub(text, "#p7#", ATLASLOOT_LEATHERWORKING);
93 text = gsub(text, "#p8#", ATLASLOOT_TAILORING);
94 text = gsub(text, "#p9#", ATLASLOOT_DRAGONSCALE);
95 text = gsub(text, "#p10#", ATLASLOOT_TRIBAL);
96 text = gsub(text, "#p11#", ATLASLOOT_ELEMENTAL);
97  
98 --Reputation
99 text = gsub(text, "#r1#", ATLASLOOT_NEUTRAL);
100 text = gsub(text, "#r2#", ATLASLOOT_FRIENDLY);
101 text = gsub(text, "#r3#", ATLASLOOT_HONORED);
102 text = gsub(text, "#r4#", ATLASLOOT_REVERED);
103 text = gsub(text, "#r5#", ATLASLOOT_EXALTED);
104  
105 --Battleground Factions
106 text = gsub(text, "#b1#", ATLASLOOT_BG_STORMPIKE);
107 text = gsub(text, "#b2#", ATLASLOOT_BG_FROSTWOLF);
108 text = gsub(text, "#b3#", ATLASLOOT_BG_SENTINELS);
109 text = gsub(text, "#b4#", ATLASLOOT_BG_OUTRIDERS);
110 text = gsub(text, "#b5#", ATLASLOOT_BG_ARATHOR);
111 text = gsub(text, "#b6#", ATLASLOOT_BG_DEFILERS);
112  
113 -- Misc phrases and mod specific stuff
114 text = gsub(text, "#m1#", ATLASLOOT_CLASSES);
115 text = gsub(text, "#m2#", ATLASLOOT_QUEST1);
116 text = gsub(text, "#m3#", ATLASLOOT_QUEST2);
117 text = gsub(text, "#m4#", ATLASLOOT_QUEST3);
118 text = gsub(text, "#m5#", ATLASLOOT_SHARED);
119 text = gsub(text, "#m6#", ATLASLOOT_HORDE);
120 text = gsub(text, "#m7#", ATLASLOOT_ALLIANCE);
121 text = gsub(text, "#m8#", ATLASLOOT_UNIQUE);
122 text = gsub(text, "#m9#", ATLASLOOT_RIGHTSIDE);
123 text = gsub(text, "#m10#", ATLASLOOT_LEFTSIDE);
124 text = gsub(text, "#m11#", ATLASLOOT_FELCOREBAG);
125 text = gsub(text, "#m12#", ATLASLOOT_ONYBAG);
126 text = gsub(text, "#m13#", ATLASLOOT_WCBAG);
127 text = gsub(text, "#m14#", ATLASLOOT_FULLSKILL);
128 text = gsub(text, "#m15#", ATLASLOOT_295);
129 text = gsub(text, "#m16#", ATLASLOOT_275);
130 text = gsub(text, "#m17#", ATLASLOOT_265);
131 text = gsub(text, "#m18#", ATLASLOOT_290);
132 text = gsub(text, "#m19#", ATLASLOOT_SET);
133 text = gsub(text, "#m20#", ATLASLOOT_285);
134 text = gsub(text, "#m21#", ATLASLOOT_16SLOT);
135  
136 text = gsub(text, "#x1#", ATLASLOOT_COBRAHN);
137 text = gsub(text, "#x2#", ATLASLOOT_ANACONDRA);
138 text = gsub(text, "#x3#", ATLASLOOT_SERPENTIS);
139 text = gsub(text, "#x4#", ATLASLOOT_FANGDRUID);
140 text = gsub(text, "#x5#", ATLASLOOT_PYTHAS);
141 text = gsub(text, "#x6#", ATLASLOOT_VANCLEEF);
142 text = gsub(text, "#x7#", ATLASLOOT_GREENSKIN);
143 text = gsub(text, "#x8#", ATLASLOOT_DEFIASMINER);
144 text = gsub(text, "#x9#", ATLASLOOT_DEFIASOVERSEER);
145 text = gsub(text, "#x10#", ATLASLOOT_Primal_Hakkari_Kossack);
146 text = gsub(text, "#x11#", ATLASLOOT_Primal_Hakkari_Shawl);
147 text = gsub(text, "#x12#", ATLASLOOT_Primal_Hakkari_Bindings);
148 text = gsub(text, "#x13#", ATLASLOOT_Primal_Hakkari_Sash);
149 text = gsub(text, "#x14#", ATLASLOOT_Primal_Hakkari_Stanchion);
150 text = gsub(text, "#x15#", ATLASLOOT_Primal_Hakkari_Aegis);
151 text = gsub(text, "#x16#", ATLASLOOT_Primal_Hakkari_Girdle);
152 text = gsub(text, "#x17#", ATLASLOOT_Primal_Hakkari_Armsplint);
153 text = gsub(text, "#x18#", ATLASLOOT_Primal_Hakkari_Tabard);
154 text = gsub(text, "#x19#", ATLASLOOT_Qiraji_Ornate_Hilt);
155 text = gsub(text, "#x20#", ATLASLOOT_Qiraji_Martial_Drape);
156 text = gsub(text, "#x21#", ATLASLOOT_Qiraji_Magisterial_Ring);
157 text = gsub(text, "#x22#", ATLASLOOT_Qiraji_Ceremonial_Ring);
158 text = gsub(text, "#x23#", ATLASLOOT_Qiraji_Regal_Drape);
159 text = gsub(text, "#x24#", ATLASLOOT_Qiraji_Spiked_Hilt);
160 text = gsub(text, "#x25#", ATLASLOOT_Qiraji_Bindings_of_Dominance);
161 text = gsub(text, "#x26#", ATLASLOOT_Veknilashs_Circlet);
162 text = gsub(text, "#x27#", ATLASLOOT_Ouros_Intact_Hide);
163 text = gsub(text, "#x28#", ATLASLOOT_Husk_of_the_Old_God);
164 text = gsub(text, "#x29#", ATLASLOOT_Qiraji_Bindings_of_Command);
165 text = gsub(text, "#x30#", ATLASLOOT_Veklors_Diadem);
166 text = gsub(text, "#x31#", ATLASLOOT_Skin_of_the_Great_Sandworm);
167 text = gsub(text, "#x32#", ATLASLOOT_Carapace_of_the_Old_God);
168 text = gsub(text, "#x33#", ATLASLOOT_SCARLETDEFENDER);
169 text = gsub(text, "#x34#", ATLASLOOT_SCARLETTRASH);
170 text = gsub(text, "#x35#", ATLASLOOT_SCARLETCHAMPION);
171 text = gsub(text, "#x36#", ATLASLOOT_SCARLETCENTURION);
172 text = gsub(text, "#x37#", ATLASLOOT_SCARLETHEROD);
173 text = gsub(text, "#x38#", ATLASLOOT_SCARLETPROTECTOR);
174  
175 --Text colouring
176 text = gsub(text, "=q0=", "|cff9d9d9d");
177 text = gsub(text, "=q1=", "|cffFFFFFF");
178 text = gsub(text, "=q2=", "|cff1eff00");
179 text = gsub(text, "=q3=", "|cff0070dd");
180 text = gsub(text, "=q4=", "|cff9F3FFF");
181 text = gsub(text, "=q5=", "|cffFF8400");
182 text = gsub(text, "=q6=", "|cffFF0000");
183 text = gsub(text, "=ds=", "|cffFFd200");
184 return text;
185 end
186  
187 function MetaMapBLT_OnSelect(lootID, name)
188 if(lootID == nil) then return; end
189 local info;
190 if(lootID and lootID ~= "") then
191 MetaMapBLT_ToggleDR(1);
192 local itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture, itemColor;
193 local iconFrame, nameFrame, extraFrame;
194 local text, extra;
195 if(string.find(lootID, "CLASS_SET")) then
196 MetaMapBLT_SetMenu(lootID, name);
197 info = METAMAPBLT_CLASS_SELECT;
198 lootID = nil;
199 end
200 for i = 1, 30, 1 do
201 if(MetaMapBLTData[lootID] ~= nil and MetaMapBLTData[lootID][i] ~= nil and MetaMapBLTData[lootID][i][3] ~= "") then
202 itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(MetaMapBLTData[lootID][i][1]);
203 if(GetItemInfo(MetaMapBLTData[lootID][i][1])) then
204 _, _, _, itemColor = GetItemQualityColor(itemQuality);
205 text = itemColor..itemName;
206 else
207 text = MetaMapBLTData[lootID][i][3];
208 text = MetaMapBLT_FixText(text);
209 end
210  
211 extra = MetaMapBLTData[lootID][i][4];
212 extra = MetaMapBLT_FixText(extra)
213 if(not GetItemInfo(MetaMapBLTData[lootID][i][1]) and (MetaMapBLTData[lootID][i][1] ~= 0)) then
214 extra = extra.." |cffff0000(no iteminfo)";
215 end
216  
217 getglobal("MetaMapBLTItem_"..i.."_Icon"):SetTexture("Interface\\Icons\\"..MetaMapBLTData[lootID][i][2]);
218 getglobal("MetaMapBLTItem_"..i.."_Extra"):SetText(extra);
219 getglobal("MetaMapBLTItem_"..i.."_Name"):SetText(text);
220 getglobal("MetaMapBLTItem_"..i).itemID = MetaMapBLTData[lootID][i][1];
221 getglobal("MetaMapBLTItem_"..i).storeID = MetaMapBLTData[lootID][i][1];
222 getglobal("MetaMapBLTItem_"..i).droprate = MetaMapBLTData[lootID][i][5];
223 getglobal("MetaMapBLTItem_"..i).i = 1;
224 getglobal("MetaMapBLTItem_"..i):Show();
225 MetaMapContainer_InfoText:Hide();
226 else
227 getglobal("MetaMapBLTItem_"..i):Hide();
228 end
229 if(MetaMapBLTData[lootID] == nil and info == nil) then
230 info = METAMAPBLT_NO_DATA;
231 end
232 end
233 else
234 for i = 1, 30, 1 do
235 getglobal("MetaMapBLTItem_"..i):Hide();
236 end
237 info = METAMAPBLT_NO_INFO;
238 end
239 MetaMapContainer_ShowFrame(MetaMapBLT_SubFrame, name, METAMAPBLT_HINT, info);
240 end
241  
242 function MetaMapBLTItem_OnEnter()
243 if(this.itemID ~= nil) then
244 if(IsAddOnLoaded("LootLink") and GetItemInfo(this.itemID) == nil) then
245 GameTooltip:SetOwner(this, "ANCHOR_RIGHT", -200, 0);
246 LootLink_SetTooltip(GameTooltip, strsub(getglobal("MetaMapBLTItem_"..this:GetID().."_Name"):GetText(), 11), 1);
247 if( this.droprate ~= nil) then
248 GameTooltip:AddLine("Drop Rate: "..this.droprate, 1, 1, 0);
249 end
250 GameTooltip:Show();
251 elseif(IsAddOnLoaded("ItemSync")) then
252 ISync:ButtonEnter();
253 if( this.droprate ~= nil) then
254 GameTooltip:AddLine("Drop Rate: "..this.droprate, 1, 1, 0);
255 GameTooltip:Show();
256 end
257 elseif(this.itemID ~= nil and GetItemInfo(this.itemID) ~= nil) then
258 GameTooltip:SetOwner(this, "ANCHOR_RIGHT", -200, 0);
259 GameTooltip:SetHyperlink("item:"..this.itemID..":0:0:0");
260 if( this.droprate ~= nil) then
261 GameTooltip:AddLine("Drop Rate: "..this.droprate, 1, 1, 0);
262 end
263 GameTooltip:Show();
264 end
265 end
266 end
267  
268 function MetaMapBLTItem_OnClick()
269 local iteminfo = GetItemInfo(this.itemID);
270 local color = strsub(getglobal("MetaMapBLTItem_"..this:GetID().."_Name"):GetText(), 1, 10);
271 local name = strsub(getglobal("MetaMapBLTItem_"..this:GetID().."_Name"):GetText(), 11);
272 if(ChatFrameEditBox:IsVisible() and IsShiftKeyDown() and iteminfo) then
273 ChatFrameEditBox:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..name.."]|h|r");
274 elseif(IsControlKeyDown() and iteminfo) then
275 DressUpItemLink(this.itemID);
276 DressUpFrame:Show();
277 DressUpItemLink(this.itemID);
278 elseif(IsAddOnLoaded("ItemSync")) then
279 ISync:AddTooltipInfo(GameTooltip, "item:"..this.itemID..":0:0:0", 1);
280 end
281 end
282  
283 function MetaMapBLT_SetMenu(lootID, name)
284 MetaMapBLT_ClassSet = string.gsub(lootID, "CLASS_SET", "")
285 MetaMapBLT_ClassName = name;
286 MetaMapContainer_ShowFrame(MetaMapBLT_SubFrame, name, METAMAPBLT_HINT, info);
287 MetaMapBLT_ClassMenu:Show();
288 end
289  
290 function MetaMapBLT_MenuOnClick()
291 local className = MetaMapBLT_ClassSet..getglobal(this:GetName().."ClassName"):GetText();
292 local header = MetaMapBLT_ClassName.." - "..this:GetText();
293 MetaMapBLT_OnSelect(className, header);
294 end
295  
296 function MetaMapBLT_ToggleDR(mode)
297 if(mode == 1) then
298 DressUpFrame:SetMovable(true);
299 DressUpFrame:SetFrameStrata("FULLSCREEN");
300 DressUpFrame:SetScript("OnMouseDown", X_Frame:GetScript("OnMouseDown"));
301 DressUpFrame:SetScript("OnMouseUp", X_Frame:GetScript("OnMouseUp"));
302 else
303 DressUpFrame:SetMovable(false);
304 DressUpFrame:SetFrameStrata("HIGH");
305 DressUpFrame:SetScript("OnMouseDown", nil);
306 DressUpFrame:SetScript("OnMouseUp", nil);
307 end
308 end
309  
310 function MetaMapBLTItem_OnLeave()
311 GameTooltip:Hide();
312 end
313  
314 function MetaMapBLT_SetClassColors()
315 local color;
316 color = RAID_CLASS_COLORS["DRUID"];
317 MetaMapBLT_DruidButton:SetTextColor(color.r, color.g, color.b);
318 color = RAID_CLASS_COLORS["HUNTER"];
319 MetaMapBLT_HunterButton:SetTextColor(color.r, color.g, color.b);
320 color = RAID_CLASS_COLORS["MAGE"];
321 MetaMapBLT_MageButton:SetTextColor(color.r, color.g, color.b);
322 color = RAID_CLASS_COLORS["PALADIN"];
323 MetaMapBLT_PaladinButton:SetTextColor(color.r, color.g, color.b);
324 color = RAID_CLASS_COLORS["PRIEST"];
325 MetaMapBLT_PriestButton:SetTextColor(color.r, color.g, color.b);
326 color = RAID_CLASS_COLORS["ROGUE"];
327 MetaMapBLT_RogueButton:SetTextColor(color.r, color.g, color.b);
328 color = RAID_CLASS_COLORS["SHAMAN"];
329 MetaMapBLT_ShamanButton:SetTextColor(color.r, color.g, color.b);
330 color = RAID_CLASS_COLORS["WARLOCK"];
331 MetaMapBLT_WarlockButton:SetTextColor(color.r, color.g, color.b);
332 color = RAID_CLASS_COLORS["WARRIOR"];
333 MetaMapBLT_WarriorButton:SetTextColor(color.r, color.g, color.b);
334 end