-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelUpDisplay.lua
606 lines (524 loc) · 19.8 KB
/
LevelUpDisplay.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
local _, MLU = ...;
local L = MLU;
-- MLU NEW FUNCTIONS — HACK FOR CUSTOM CHAT LINKS
MLU_LEVEL_UP_BG_LINK = "|cffFF4E00|Hgarrmission:MLU:pvpbgs|h["..BATTLEGROUNDS.."]|h|r";
hooksecurefunc("SetItemRef", function(link)
local linkType, addon, param = strsplit(":", link);
if linkType == "garrmission" and addon == "MLU" then
MLU_CustomChatLink_OnClick(param);
end
end);
local wasHooked;
function MLU_CustomChatLink_OnClick(param)
if wasHooked then
if InCombatLockdown() then
UIErrorsFrame:AddMessage(ERR_NOT_IN_COMBAT, 1.0, 0.1, 0.1, 1.0);
elseif ( param == "pvpbgs" ) then
TogglePVPFrame();
elseif ( param == "glyphpane" ) then
ToggleGlyphFrame();
end
wasHooked = nil;
else
wasHooked = 1;
end
end
-- MLU NEW FUNCTION
local Orig_ChatFrame_DisplayLevelUp = ChatFrame_DisplayLevelUp;
ChatFrame_DisplayLevelUp = function(self, level, ...)
LevelUpDisplay_ChatPrint(self, level, LEVEL_UP_TYPE_CHARACTER);
end;
----------------------------------------------------------------------------------
LEVEL_UP_TYPE_CHARACTER = "character"; --Name used in globalstring LEVEL_UP
--[[ LEVEL_UP_TYPE_GUILD = "guild"; ]] --Name used in globalstring GUILD_LEVEL_UP
LEVEL_UP_TYPE_PET = "pet" -- Name used in globalstring PET_LEVEL_UP
LEVEL_UP_EVENTS = {
-- Level = {unlock}
[10] = {"TalentsUnlocked", "BGsUnlocked"},
[15] = {--[[ "LFDUnlocked", ]]"GlyphMajor",},
[30] = {"DuelSpec", "GlyphMajor"},
[80] = {"GlyphMajor"},--,"GlyphMajor", "GlyphMinor"},
}
SUBICON_TEXCOOR_BOOK = {0.64257813, 0.72070313, 0.03710938, 0.11132813};
SUBICON_TEXCOOR_LOCK = {0.64257813, 0.70117188, 0.11523438, 0.18359375};
SUBICON_TEXCOOR_ARROW = {0.72460938, 0.78320313, 0.03710938, 0.10351563};
local levelUpTexCoords = {
[LEVEL_UP_TYPE_CHARACTER] = {
dot = { 0.64257813, 0.68359375, 0.18750000, 0.23046875 },
goldBG = { 0.56054688, 0.99609375, 0.24218750, 0.46679688 },
gLine = { 0.00195313, 0.81835938, 0.01953125, 0.03320313 },
},
--[[ [LEVEL_UP_TYPE_GUILD] = {
dot = { 0.64257813, 0.68359375, 0.77734375, 0.8203125 },
goldBG = { 0.56054688, 0.99609375, 0.486328125, 0.7109375 },
gLine = { 0.00195313, 0.81835938, 0.96484375, 0.97851563 },
textTint = {0.11765, 1, 0},
}, ]]
[LEVEL_UP_TYPE_PET] = {
dot = { 0.64257813, 0.68359375, 0.18750000, 0.23046875 },
goldBG = { 0.56054688, 0.99609375, 0.24218750, 0.46679688 },
gLine = { 0.00195313, 0.81835938, 0.01953125, 0.03320313 },
tint = {1, 0.5, 0.25},
textTint = {1, 0.7, 0.25},
},
}
LEVEL_UP_TYPES = {
["TalentPoint"] = { icon="Interface\\Icons\\Ability_Marksmanship",
subIcon=SUBICON_TEXCOOR_ARROW,
text=L["MLU_LEVEL_UP_TALENT_MAIN"],
subText=LEVEL_UP_TALENT_SUB,
link=LEVEL_UP_TALENTPOINT_LINK; -- doesn't work
},
["PetTalentPoint"] = { icon="Interface\\Icons\\Ability_Marksmanship",
subIcon=SUBICON_TEXCOOR_ARROW,
text=PET_LEVEL_UP_TALENT_MAIN,
subText=PET_LEVEL_UP_TALENT_SUB,
link=PET_LEVEL_UP_TALENTPOINT_LINK; -- doesn't have this
},
["TalentsUnlocked"] = { icon="Interface\\Icons\\Ability_Marksmanship",
subIcon=SUBICON_TEXCOOR_LOCK,
text=TALENT_POINTS,
subText=LEVEL_UP_FEATURE,
link=LEVEL_UP_FEATURE2..LEVEL_UP_TALENTS_LINK -- doesn't work
},
["BGsUnlocked"] = { icon="Interface\\Icons\\Ability_DualWield",
subIcon=SUBICON_TEXCOOR_LOCK,
text=BATTLEFIELDS,
subText=LEVEL_UP_FEATURE,
link=LEVEL_UP_FEATURE2..MLU_LEVEL_UP_BG_LINK -- doesn't work
},
--[[ ["LFDUnlocked"] = { icon="Interface\\Icons\\LevelUpIcon-LFD",
subIcon=SUBICON_TEXCOOR_LOCK,
text=LOOKING_FOR_DUNGEON,
subText=LEVEL_UP_FEATURE,
link=LEVEL_UP_FEATURE2..LEVEL_UP_LFD_LINK
}, ]]
--[[ ["GlyphPrime"] = { icon="Interface\\Icons\\Inv_inscription_tradeskill01",
subIcon=SUBICON_TEXCOOR_LOCK,
text=GLYPHS,
subText=LEVEL_UP_FEATURE,
link=LEVEL_UP_GLYPH3_LINK
}, ]]
["GlyphMajor"] = { icon="Interface\\Icons\\Inv_inscription_tradeskill01",
subIcon=SUBICON_TEXCOOR_LOCK,
text=GLYPHS,
subText=LEVEL_UP_FEATURE,
link=L["MLU_LEVEL_UP_GLYPH1_LINK"] -- doesn't work
},
["GlyphMinor"] = { icon="Interface\\Icons\\Inv_inscription_tradeskill01",
subIcon=SUBICON_TEXCOOR_LOCK,
text=GLYPHS,
subText=LEVEL_UP_FEATURE,
link=L["MLU_LEVEL_UP_GLYPH2_LINK"] -- doesn't work
},
["DuelSpec"] = { icon="Interface\\Icons\\INV_Misc_Coin_01",
subIcon=SUBICON_TEXCOOR_LOCK,
text=LEVEL_UP_DUALSPEC,
subText=LEVEL_UP_FEATURE,
link=LEVEL_UP_FEATURE2..LEVEL_UP_DUAL_SPEC_LINK -- doesn't work
},
------ HACKS BELOW
["LockMount1"] = { spellID=5784 },
["LockMount2"] = { spellID=23161 },
["PaliMount1"] = { spellID=34769 },
["PaliMount2"] = { spellID=34767 },
["Plate"] = { spellID=750, feature=true},
["Mail"] = { spellID=8737, feature=true},
["TrackBeast"] = { spellID=1494 },
["TrackHumanoid"] = { spellID=19883 },
["TrackUndead"] = { spellID=19884 },
["TrackHidden"] = { spellID=19885 },
["TrackElemental"] = { spellID=19880 },
["TrackDemons"] = { spellID=19878 },
["TrackGiants"] = { spellID=19882 },
["TrackDragonkin"] = { spellID=19879 },
------ END HACKS
}
LEVEL_UP_CLASS_HACKS = {
["WARLOCK"] = {
-- Level = {unlock}
[20] = {"LockMount1"},
[40] = {"LockMount2"},
},
["SHAMAN"] = {
-- Level = {unlock}
[40] = {"Mail"},
},
["HUNTER"] = {
-- Level = {unlock}
--[[ [4] = {"TrackBeast"},
[12] = {"TrackHumanoid"},
[18] = {"TrackUndead"},
[26] = {"TrackHidden"},
[34] = {"TrackElemental"},
[36] = {"TrackDemons"}, ]]
[40] = {"Mail"},
--[[ [46] = {"TrackGiants"},
[52] = {"TrackDragonkin"}, ]]
},
["WARRIOR"] = {
-- Level = {unlock}
[40] = {"Plate"},
},
["PALADIN"] = {
-- Level = {unlock}
[20] = {"PaliMount1"},
[40] = {"PaliMount2", "Plate"},
},
}
-- MLU NEW FUNCTION
--/run LevelUpDisplay_OnEvent(LevelUpDisplay, "PLAYER_LEVEL_UP", 10)
local testLevelCounter = 2;
function MLU_TestLevelUp(level)
if level then
LevelUpDisplay_OnEvent(LevelUpDisplay, "PLAYER_LEVEL_UP", level);
LevelUpDisplay_ChatPrint(ChatFrame1, level, LEVEL_UP_TYPE_CHARACTER);
PlaySound(888);
testLevelCounter = level + 1;
else
LevelUpDisplay_OnEvent(LevelUpDisplay, "PLAYER_LEVEL_UP", testLevelCounter);
LevelUpDisplay_ChatPrint(ChatFrame1, testLevelCounter, LEVEL_UP_TYPE_CHARACTER);
PlaySound(888);
testLevelCounter = testLevelCounter + 1;
end
end
function LevelUpDisplay_OnLoad(self)
self:RegisterEvent("PLAYER_LEVEL_UP");
--[[ self:RegisterEvent("UNIT_GUILD_LEVEL"); ]]
--[[ self:RegisterEvent("UNIT_LEVEL"); ]]
self.currSpell = 0;
end
function LevelUpDisplay_OnEvent(self, event, ...)
local arg1 = ...;
if event == "PLAYER_LEVEL_UP" then
local level = ...
self.level = level;
self.type = LEVEL_UP_TYPE_CHARACTER;
self:Show();
LevelUpDisplaySide:Hide();
--[[ elseif event == "UNIT_GUILD_LEVEL" then
local unit, level = ...;
if ( unit == "player" ) then
self.level = level;
self.type = LEVEL_UP_TYPE_GUILD;
self:Show();
LevelUpDisplaySide:Hide();
end ]]
elseif event == "UNIT_LEVEL" and arg1 == "pet" then
if (UnitName("pet") ~= UNKNOWNOBJECT) then
self.level = UnitLevel("pet");
self.type = LEVEL_UP_TYPE_PET;
self:Show();
LevelUpDisplaySide:Hide();
end
end
end
-- MLU NEW FUNCTION
function MLU_GetNextTalentLevel(level)
if (level) then
return max(10, level + 1);
else
local level = UnitLevel("player");
return max(10, level + 1);
end
end
-- MLU NEW FUNCTION
function MLU_GetCurrentLevelSpells(level)
if (not level) then
return nil;
end
local IDsTable = {};
local spellsOnLvl = MLU.SpellsByLevel[level];
local faction = UnitFactionGroup("player");
if (spellsOnLvl) then
for i=1, #spellsOnLvl do
if ( spellsOnLvl[i].faction and (faction ~= spellsOnLvl[i].faction) ) then
-- skip
else
IDsTable[i] = spellsOnLvl[i].id;
end
end
end
return IDsTable;
end
-- MLU NEW FUNCTION
--[[
Original function gives results on 1, 50, 60, 68, 70, 80 levels:
1: 5019 ("Выстрел", не должно отображаться)
50: 89744 ("Волшебство", пассивка - не существует в ВотЛК)
60: 34090, 90267 ("Верховая езда (умелец)", "Лицензия мастера воздушных путей" - полеты в Азероте не должны отображаться)
68: 54197 ("Полеты в непогоду")
70: 34091 ("Верховая езда (искусник)")
80: 86473, 90265 ("Искусность" пассивка, не должно отображаться, "Мастер верховой езды" - полеты 310% не должны отображаться)
]]
function MLU_GetCurrentLevelFeatures(level)
local featuresTable = {
[1] = 5019, -- ??
[20] = 33388, -- 60% riding skill
[40] = 33391, -- 100% riding skill
[60] = 34090, -- 150% flying skill
[68] = 54197, -- Northrend flying skill (probably need to be hidden)
[70] = 34091, -- 280% flying skill
};
if (featuresTable[level]) then
return featuresTable[level];
else
return nil;
end
end
function LevelUpDisplay_BuildCharacterList(self)
local name, icon = "","";
self.unlockList = {};
if LEVEL_UP_EVENTS[self.level] then
for _, unlockType in pairs(LEVEL_UP_EVENTS[self.level]) do
self.unlockList[#self.unlockList +1] = LEVEL_UP_TYPES[unlockType];
end
end
if self.level == MLU_GetNextTalentLevel(self.level-1) then
self.unlockList[#self.unlockList +1] = LEVEL_UP_TYPES["TalentPoint"]
end
local spells = MLU_GetCurrentLevelSpells(self.level);
for _,spell in pairs(spells) do
name, _, icon = GetSpellInfo(spell);
C_Spell.RequestLoadSpellData(spell);
rank = GetSpellSubtext(spell);
if (rank and rank ~= "") then
rank = " ("..rank..")";
else
rank = "";
end
if GetSpellLink(spell) then
self.unlockList[#self.unlockList +1] = { text = name..rank, subText = LEVEL_UP_ABILITY, icon = icon, subIcon = SUBICON_TEXCOOR_BOOK,
link=LEVEL_UP_ABILITY2.." "..GetSpellLink(spell)
};
end
end
-- This loop is LEVEL_UP_CLASS_HACKS
local race, raceFile = UnitRace("player");
local _, class = UnitClass("player");
local factionName = UnitFactionGroup("player");
local hackTable = LEVEL_UP_CLASS_HACKS[class..raceFile] or LEVEL_UP_CLASS_HACKS[class..factionName] or LEVEL_UP_CLASS_HACKS[class];
if hackTable and hackTable[self.level] then
hackTable = hackTable[self.level];
for _,spelltype in pairs(hackTable) do
if LEVEL_UP_TYPES[spelltype] and LEVEL_UP_TYPES[spelltype].spellID then
if LEVEL_UP_TYPES[spelltype].feature then
name, _, icon = GetSpellInfo(LEVEL_UP_TYPES[spelltype].spellID);
self.unlockList[#self.unlockList +1] = { text = name, subText = LEVEL_UP_FEATURE, icon = icon, subIcon = SUBICON_TEXCOOR_LOCK,
link=LEVEL_UP_FEATURE2.." "..GetSpellLink(LEVEL_UP_TYPES[spelltype].spellID)
};
else
name, _, icon = GetSpellInfo(LEVEL_UP_TYPES[spelltype].spellID);
self.unlockList[#self.unlockList +1] = { text = name, subText = LEVEL_UP_ABILITY, icon = icon, subIcon = SUBICON_TEXCOOR_BOOK,
link=LEVEL_UP_ABILITY2.." "..GetSpellLink(LEVEL_UP_TYPES[spelltype].spellID)
};
end
end
end
end
local features = {MLU_GetCurrentLevelFeatures(self.level)};
for _,feature in pairs(features) do
name, _, icon = GetSpellInfo(feature);
self.unlockList[#self.unlockList +1] = { text = name, subText = LEVEL_UP_FEATURE, icon = icon, subIcon = SUBICON_TEXCOOR_LOCK,
link=LEVEL_UP_FEATURE2..GetSpellLink(feature)
};
end
self.currSpell = 1;
end
function LevelUpDisplay_BuildPetList(self)
local name, icon = "","";
self.unlockList = {};
if self.level == GetNextPetTalentLevel(self.level-1) then
self.unlockList[#self.unlockList +1] = LEVEL_UP_TYPES["PetTalentPoint"]
end
-- TODO: Pet Spells
self.currSpell = 1;
end
function LevelUpDisplay_BuildGuildList(self)
local name, icon = "", "";
self.unlockList = {};
for i=1, GetNumGuildPerks() do
local name, spellID, iconTexture, level = GetGuildPerkInfo(i);
if ( level == self.level ) then
tinsert(self.unlockList, { text = name, subText = GUILD_LEVEL_UP_PERK, icon = iconTexture, subIcon = SUBICON_TEXCOOR_LOCK,
link = GUILD_LEVEL_UP_PERK2.." "..GetSpellLink(spellID)
});
end
end
self.currSpell = 1;
end
function LevelUpDisplay_OnShow(self)
if self.currSpell == 0 then
if ( self.type == LEVEL_UP_TYPE_CHARACTER ) then
LevelUpDisplay_BuildCharacterList(self);
self.levelFrame.reachedText:SetText(LEVEL_UP_YOU_REACHED);
self.levelFrame.levelText:SetFormattedText(L["MLU_LEVEL_GAINED"],self.level);
elseif ( self.type == LEVEL_UP_TYPE_PET ) then
LevelUpDisplay_BuildPetList(self);
local petName = UnitName("pet");
self.levelFrame.reachedText:SetFormattedText(PET_LEVEL_UP_REACHED, petName or "");
self.levelFrame.levelText:SetFormattedText(L["MLU_LEVEL_GAINED"],self.level);
--[[ elseif ( self.type == LEVEL_UP_TYPE_GUILD ) then
LevelUpDisplay_BuildGuildList(self);
local guildName = GetGuildInfo("player");
self.levelFrame.reachedText:SetFormattedText(GUILD_LEVEL_UP_YOU_REACHED, guildName);
self.levelFrame.levelText:SetFormattedText(L["MLU_LEVEL_GAINED"],self.level); ]]
end
self.gLine:SetTexCoord(unpack(levelUpTexCoords[self.type].gLine));
self.gLine2:SetTexCoord(unpack(levelUpTexCoords[self.type].gLine));
if (levelUpTexCoords[self.type].tint) then
self.gLine:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
self.gLine2:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
else
self.gLine:SetVertexColor(1, 1, 1);
self.gLine2:SetVertexColor(1, 1, 1);
end
if (levelUpTexCoords[self.type].textTint) then
self.levelFrame.levelText:SetTextColor(unpack(levelUpTexCoords[self.type].textTint));
else
self.levelFrame.levelText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
self.levelFrame.levelUp:Play();
end
end
function LevelUpDisplay_AnimStep(self)
if self.currSpell > #self.unlockList then
self.currSpell = 0;
self.hideAnim:Play();
else
local spellInfo = self.unlockList[self.currSpell];
self.currSpell = self.currSpell+1;
self.spellFrame.name:SetText(spellInfo.text);
self.spellFrame.flavorText:SetText(spellInfo.subText);
self.spellFrame.icon:SetTexture(spellInfo.icon);
self.spellFrame.subIcon:SetTexCoord(unpack(spellInfo.subIcon));
self.spellFrame.showAnim:Play();
end
end
--local _, level, levelUpType, arg1 = strsplit(":", link);
--LevelUpDisplay_ShowSideDisplay(tonumber(level), _G[levelUpType], arg1);
--Side display Functions
function LevelUpDisplay_ShowSideDisplay(level, levelUpType, arg1)
if LevelUpDisplaySide.level and LevelUpDisplaySide.level == level and LevelUpDisplaySide.type == levelUpType and LevelUpDisplaySide.arg1 == arg1 then
if LevelUpDisplaySide:IsVisible() then
LevelUpDisplaySide:Hide();
else
LevelUpDisplaySide:Show();
end
else
LevelUpDisplaySide.level = level;
LevelUpDisplaySide.type = levelUpType;
LevelUpDisplaySide.arg1 = arg1;
LevelUpDisplaySide:Hide();
LevelUpDisplaySide:Show();
end
end
function LevelUpDisplaySide_OnShow(self)
if ( self.type == LEVEL_UP_TYPE_CHARACTER ) then
LevelUpDisplay_BuildCharacterList(self);
self.reachedText:SetText(LEVEL_UP_YOU_REACHED);
self.levelText:SetFormattedText(L["MLU_LEVEL_GAINED"],self.level);
elseif ( self.type == LEVEL_UP_TYPE_PET ) then
LevelUpDisplay_BuildPetList(self);
local petName = self.arg1;
self.reachedText:SetFormattedText(PET_LEVEL_UP_REACHED, petName);
self.levelText:SetFormattedText(L["MLU_LEVEL_GAINED"],self.level);
--[[ elseif ( self.type == LEVEL_UP_TYPE_GUILD ) then
LevelUpDisplay_BuildGuildList(self);
local guildName = GetGuildInfo("player");
self.reachedText:SetFormattedText(GUILD_LEVEL_UP_YOU_REACHED, guildName);
self.levelText:SetFormattedText(L["MLU_LEVEL_GAINED"],self.level); ]]
end
self.goldBG:SetTexCoord(unpack(levelUpTexCoords[self.type].goldBG));
self.dot:SetTexCoord(unpack(levelUpTexCoords[self.type].dot));
if (levelUpTexCoords[self.type].tint) then
self.goldBG:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
self.dot:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
else
self.goldBG:SetVertexColor(1, 1, 1);
self.dot:SetVertexColor(1, 1, 1);
end
if (levelUpTexCoords[self.type].textTint) then
self.levelText:SetTextColor(unpack(levelUpTexCoords[self.type].textTint));
else
self.levelText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
local i = 1;
local displayFrame = _G["LevelUpDisplaySideUnlockFrame1"];
while i <= #self.unlockList do
if not displayFrame then -- make frames as needed
displayFrame = CreateFrame("FRAME", "LevelUpDisplaySideUnlockFrame"..i, LevelUpDisplaySide, "LevelUpSkillTemplate");
displayFrame:SetPoint("TOP", _G["LevelUpDisplaySideUnlockFrame"..(i-1)], "BOTTOM", 0, -1);
displayFrame:SetAlpha(0.0);
end
i = i+1;
displayFrame = _G["LevelUpDisplaySideUnlockFrame"..i];
end
self:SetHeight(65);
self.fadeIn:Play();
end
function LevelUpDisplaySide_OnHide(self)
local displayFrame = _G["LevelUpDisplaySideUnlockFrame1"];
local i = 1;
while displayFrame do
if displayFrame.sideAnimIn:IsPlaying() then
displayFrame.sideAnimIn:Stop();
end
displayFrame:SetAlpha(0.0);
i = i+1;
displayFrame = _G["LevelUpDisplaySideUnlockFrame"..i];
end
end
function LevelUpDisplaySide_AnimStep(self)
if self.currSpell > 1 then
_G["LevelUpDisplaySideUnlockFrame"..(self.currSpell-1)]:SetAlpha(1.0);
end
if self.currSpell <= #self.unlockList then
local spellInfo = self.unlockList[self.currSpell];
local displayFrame = _G["LevelUpDisplaySideUnlockFrame"..self.currSpell];
displayFrame.name:SetText(spellInfo.text);
displayFrame.flavorText:SetText(spellInfo.subText);
displayFrame.icon:SetTexture(spellInfo.icon);
displayFrame.subIcon:SetTexCoord(unpack(spellInfo.subIcon));
displayFrame.sideAnimIn:Play();
self.currSpell = self.currSpell+1;
self:SetHeight(self:GetHeight()+45);
end
end
function LevelUpDisplaySide_Remove()
LevelUpDisplaySide.fadeOut:Play();
end
-- /run LevelUpDisplay_ChatPrint(ChatFrame1, level, LEVEL_UP_TYPE_CHARACTER)
-- Chat print function
function LevelUpDisplay_ChatPrint(self, level, levelUpType)
local info;
local chatLevelUP = {level = level, type = levelUpType};
local levelstring;
if ( levelUpType == LEVEL_UP_TYPE_CHARACTER ) then
LevelUpDisplay_BuildCharacterList(chatLevelUP);
levelstring = format(L["MLU_LEVEL_UP"], level, level);
info = ChatTypeInfo["SYSTEM"];
elseif ( levelUpType == LEVEL_UP_TYPE_PET ) then
LevelUpDisplay_BuildPetList(chatLevelUP);
local petName = UnitName("pet");
if (petName) then
levelstring = format(PET_LEVEL_UP, petName, level, petName, level);
else
levelstring = "";
end
info = ChatTypeInfo["SYSTEM"];
--[[ elseif ( levelUpType == LEVEL_UP_TYPE_GUILD ) then
LevelUpDisplay_BuildGuildList(chatLevelUP);
local guildName = GetGuildInfo("player");
levelstring = format(GUILD_LEVEL_UP, guildName, level, level);
info = ChatTypeInfo["GUILD"]; ]]
end
self:AddMessage(levelstring, info.r, info.g, info.b, info.id);
for _,skill in pairs(chatLevelUP.unlockList) do
self:AddMessage(skill.link, info.r, info.g, info.b, info.id);
end
if levelUpType == LEVEL_UP_TYPE_CHARACTER and (level == 15 or level == 30 or level == 80) then
--[[ self:AddMessage(L["MLU_LEVEL_UP_GLYPH1_LINK"], info.r, info.g, info.b, info.id); ]]
self:AddMessage(L["MLU_LEVEL_UP_GLYPH2_LINK"], info.r, info.g, info.b, info.id);
end
end