Skip to content

Commit 9f40140

Browse files
authored
TBC Anniversary support
1 parent ccfbf55 commit 9f40140

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+84513
-244
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body:
3737
- Mists of Pandaria Classic
3838
- Cataclysm Classic
3939
- Titan Reforged
40+
- Burning Crusade Anniversary
4041
- Classic Era
4142
validations:
4243
required: true

.luacheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ globals = {
8989
"C_DateAndTime",
9090
"C_EditMode",
9191
"ChatFrame_AddMessageEventFilter",
92+
"ChatFrameUtil",
9293
"Clamp",
9394
"COMBAT_TEXT_SCROLL_FUNCTION",
9495
"CombatLogGetCurrentEventInfo",

WeakAuras/BuffTrigger2.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ Buff2Frame:RegisterEvent("UNIT_PET")
23852385
Buff2Frame:RegisterEvent("RAID_TARGET_UPDATE")
23862386
Buff2Frame:RegisterEvent("PLAYER_SOFT_ENEMY_CHANGED")
23872387
Buff2Frame:RegisterEvent("PLAYER_SOFT_FRIEND_CHANGED")
2388-
if WeakAuras.IsWrathOrCataOrMistsOrRetail() then
2388+
if WeakAuras.IsTBCOrWrathOrCataOrMistsOrRetail() then
23892389
Buff2Frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
23902390
Buff2Frame:RegisterEvent("ARENA_OPPONENT_UPDATE")
23912391
Buff2Frame:RegisterEvent("UNIT_ENTERED_VEHICLE")
@@ -3182,7 +3182,7 @@ function BuffTrigger.Add(data)
31823182
local groupTrigger = trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
31833183
local effectiveIgnoreSelf = (groupTrigger or trigger.unit == "nameplate") and trigger.ignoreSelf
31843184
local effectiveGroupRole = WeakAuras.IsWrathOrCataOrMistsOrRetail() and (groupTrigger and trigger.useGroupRole and trigger.group_role) or nil
3185-
local effectiveRaidRole = WeakAuras.IsClassicOrWrathOrCataOrMists() and (groupTrigger and trigger.useRaidRole and trigger.raid_role) or nil
3185+
local effectiveRaidRole = WeakAuras.IsClassicOrTBCOrWrathOrCataOrMists() and (groupTrigger and trigger.useRaidRole and trigger.raid_role) or nil
31863186
local effectiveClass = groupTrigger and trigger.useClass and trigger.class
31873187
local effectiveSpecId = WeakAuras.IsCataOrMistsOrRetail() and (groupTrigger and trigger.useActualSpec and trigger.actualSpec) or nil
31883188
local effectiveArenaSpec = WeakAuras.IsRetail() and (trigger.unit == "arena" and trigger.useArenaSpec and trigger.arena_spec) or nil

WeakAuras/Compatibility.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,18 @@ else
7676
end
7777

7878
if C_SpecializationInfo and C_SpecializationInfo.GetTalentInfo and not WeakAuras.IsClassicEra() then
79-
if WeakAuras.IsWrathClassic() then
80-
-- copy pasta from Interface/AddOns/Blizzard_DeprecatedSpecialization/Deprecated_Specialization_Wrath.lua
79+
if WeakAuras.IsTBCOrWrathOrCata() then
80+
-- copy pasta from
81+
-- Interface/AddOns/Blizzard_DeprecatedSpecialization/
82+
-- ├─ Deprecated_Specialization_TBC.lua
83+
-- ├─ Deprecated_Specialization_Wrath.lua
84+
-- └─ Deprecated_Specialization_Cata.lua
8185
Private.ExecEnv.GetTalentInfo = function(tabIndex, talentIndex, isInspect, isPet, groupIndex)
8286
local talentInfoQuery = {}
8387
talentInfoQuery.specializationIndex = tabIndex
8488
talentInfoQuery.talentIndex = talentIndex
8589
talentInfoQuery.isInspect = isInspect
90+
talentInfoQuery.isPet = isPet
8691
talentInfoQuery.groupIndex = groupIndex
8792
local talentInfo = C_SpecializationInfo.GetTalentInfo(talentInfoQuery)
8893
if not talentInfo then

WeakAuras/GenericTrigger.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ end
19981998
do
19991999
local mh = GetInventorySlotInfo("MainHandSlot")
20002000
local oh = GetInventorySlotInfo("SecondaryHandSlot")
2001-
local ranged = WeakAuras.IsClassicOrWrath() and GetInventorySlotInfo("RangedSlot")
2001+
local ranged = WeakAuras.IsClassicOrTBCOrWrath() and GetInventorySlotInfo("RangedSlot")
20022002

20032003
local swingTimerFrame;
20042004
local lastSwingMain, lastSwingOff, lastSwingRange;
@@ -2193,7 +2193,7 @@ do
21932193
end)
21942194
end
21952195
if Private.reset_ranged_swing_spells[spell] then
2196-
if WeakAuras.IsClassicOrWrath() then
2196+
if WeakAuras.IsClassicOrTBCOrWrath() then
21972197
swingStart("ranged")
21982198
else
21992199
swingStart("main")
@@ -2226,7 +2226,7 @@ do
22262226
swingTimerFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED");
22272227
swingTimerFrame:RegisterUnitEvent("UNIT_ATTACK_SPEED", "player");
22282228
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player");
2229-
if WeakAuras.IsClassicOrWrath() then
2229+
if WeakAuras.IsClassicOrTBCOrWrath() then
22302230
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_START", "player")
22312231
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_INTERRUPTED", "player")
22322232
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_FAILED", "player")
@@ -2288,7 +2288,7 @@ do
22882288
local function CheckGCD()
22892289
local event;
22902290
local startTime, duration, _, modRate
2291-
if WeakAuras.IsClassicOrWrath() then
2291+
if WeakAuras.IsClassicOrTBCOrWrath() then
22922292
startTime, duration = GetSpellCooldown(29515);
22932293
shootStart, shootDuration = GetSpellCooldown(5019)
22942294
elseif GetSpellCooldown then
@@ -2407,7 +2407,7 @@ do
24072407

24082408
if duration > 0 then
24092409
if (startTime == gcdStart and duration == gcdDuration)
2410-
or (WeakAuras.IsClassicOrWrath() and duration == shootDuration and startTime == shootStart)
2410+
or (WeakAuras.IsClassicOrTBCOrWrath() and duration == shootDuration and startTime == shootStart)
24112411
then
24122412
-- GCD cooldown, this could mean that the spell reset!
24132413
if self.expirationTime[id] and self.expirationTime[id] > endTime and self.expirationTime[id] ~= 0 then
@@ -3764,7 +3764,7 @@ function WeakAuras.WatchUnitChange(unit)
37643764
end
37653765

37663766
local roleUpdate
3767-
if WeakAuras.IsClassicOrWrath() then
3767+
if WeakAuras.IsClassicOrTBCOrWrath() then
37683768
function roleUpdate(unit, eventsToSend)
37693769
-- For classic check both raid role and group role
37703770
local oldRaidRole = watchUnitChange.unitRaidRole[unit]
@@ -4039,7 +4039,7 @@ function Private.ExecEnv.CheckTotemSpellId(spellId, triggerSpellId, followoverri
40394039
end
40404040

40414041
-- Queueable Spells
4042-
if WeakAuras.IsClassicOrWrath() then
4042+
if WeakAuras.IsClassicOrTBCOrWrath() then
40434043
local queueableSpells
40444044
local classQueueableSpells = {
40454045
["WARRIOR"] = {
@@ -4098,7 +4098,7 @@ local GetSpellPowerCost = GetSpellPowerCost or C_Spell and C_Spell.GetSpellPower
40984098
---@return number? cost
40994099
function WeakAuras.GetSpellCost(powerTypeToCheck)
41004100
local spellID = select(9, WeakAuras.UnitCastingInfo("player"))
4101-
if WeakAuras.IsClassicOrWrath() and not spellID then
4101+
if WeakAuras.IsClassicOrTBCOrWrath() and not spellID then
41024102
spellID = WeakAuras.GetQueuedSpell()
41034103
end
41044104
if spellID then
@@ -4116,7 +4116,7 @@ end
41164116

41174117
-- Weapon Enchants
41184118
do
4119-
local isCata = WeakAuras.IsCataClassic()
4119+
local hasRanged = WeakAuras.IsClassicOrTBCOrWrathOrCata()
41204120

41214121
local mh = GetInventorySlotInfo("MainHandSlot")
41224122
local oh = GetInventorySlotInfo("SecondaryHandSlot")
@@ -4131,7 +4131,7 @@ do
41314131

41324132
local rw, rw_icon, rw_exp, rw_dur, rw_name, rw_shortenedName, rw_charges, rw_EnchantID;
41334133
---@type string?
4134-
if isCata then
4134+
if hasRanged then
41354135
rw = GetInventorySlotInfo("RANGEDSLOT")
41364136
rw_icon = GetInventoryItemTexture("player", rw) or "Interface\\Icons\\INV_Misc_QuestionMark"
41374137
end
@@ -4149,7 +4149,7 @@ do
41494149
tenchFrame:RegisterEvent("WEAPON_ENCHANT_CHANGED")
41504150
end
41514151
tenchFrame:RegisterUnitEvent("UNIT_INVENTORY_CHANGED", "player")
4152-
if WeakAuras.IsClassicOrWrath() then
4152+
if WeakAuras.IsClassicOrTBCOrWrath() then
41534153
tenchFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED");
41544154
end
41554155

@@ -4182,11 +4182,11 @@ do
41824182
if(v:GetObjectType() == "FontString") then
41834183
local text = v:GetText();
41844184
if(text) then
4185-
local _, _, name, shortenedName = text:find("^((.-) ?+?[VI%d]*) ?%(%d+%D+%)$");
4185+
local _, _, name, shortenedName = text:find("^((.-) ?+?[XVI%d]*) ?%(%d+%D+%)$");
41864186
if(name and name ~= "") then
41874187
return name, shortenedName;
41884188
end
4189-
_, _, name, shortenedName = text:find("^((.-) ?+?[VI%d]*)%(%d+.%D%)$");
4189+
_, _, name, shortenedName = text:find("^((.-) ?+?[XVI%d]*)%(%d+.%D%)$");
41904190
if(name and name ~= "") then
41914191
return name, shortenedName;
41924192
end
@@ -4226,7 +4226,7 @@ do
42264226
end
42274227
oh_icon = GetInventoryItemTexture("player", oh)
42284228
end
4229-
if isCata then
4229+
if hasRanged then
42304230
if(math.abs((rw_exp or 0) - (rw_exp_new or 0)) > 1) then
42314231
rw_exp = rw_exp_new;
42324232
rw_dur = rw_rem and rw_rem / 1000;

WeakAuras/Init.lua

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ end
429429
-- save compatibility with old auras
430430
WeakAuras.IsClassic = WeakAuras.IsClassicEra
431431

432+
function WeakAuras.IsTBC()
433+
return flavor == 2
434+
end
435+
432436
---@return boolean result
433437
function WeakAuras.IsWrathClassic()
434438
return flavor == 3
@@ -450,37 +454,53 @@ function WeakAuras.IsRetail()
450454
end
451455

452456
---@return boolean result
453-
function WeakAuras.IsClassicOrCata()
454-
return WeakAuras.IsClassicEra() or WeakAuras.IsCataClassic()
457+
function WeakAuras.IsTWW()
458+
return WeakAuras.BuildInfo >= 110000
455459
end
456460

457461
---@return boolean result
458-
function WeakAuras.IsClassicOrCataOrMists()
459-
return WeakAuras.IsClassicOrCata() or WeakAuras.IsMists()
462+
function WeakAuras.IsMidnight()
463+
return WeakAuras.BuildInfo >= 120000
460464
end
461465

462466
---@return boolean result
463-
function WeakAuras.IsCataOrMists()
464-
return WeakAuras.IsCataClassic() or WeakAuras.IsMists()
467+
function WeakAuras.IsClassicOrTBC()
468+
return WeakAuras.IsClassicEra() or WeakAuras.IsTBC()
465469
end
466470

467-
function WeakAuras.IsCataOrMistsOrRetail()
468-
return WeakAuras.IsCataClassic() or WeakAuras.IsMists() or WeakAuras.IsRetail()
471+
---@return boolean result
472+
function WeakAuras.IsClassicOrWrath()
473+
return WeakAuras.IsClassicEra() or WeakAuras.IsWrathClassic()
469474
end
470475

471476
---@return boolean result
472-
function WeakAuras.IsMistsOrRetail()
473-
return WeakAuras.IsMists() or WeakAuras.IsRetail()
477+
function WeakAuras.IsClassicOrTBCOrWrath()
478+
return WeakAuras.IsClassicEra() or WeakAuras.IsTBC() or WeakAuras.IsWrathClassic()
474479
end
475480

476481
---@return boolean result
477-
function WeakAuras.IsCataOrRetail()
478-
return WeakAuras.IsCataClassic() or WeakAuras.IsRetail()
482+
function WeakAuras.IsTBCOrWrath()
483+
return WeakAuras.IsTBC() or WeakAuras.IsWrathClassic()
479484
end
480485

481486
---@return boolean result
482-
function WeakAuras.IsClassicOrWrath()
483-
return WeakAuras.IsClassicEra() or WeakAuras.IsWrathClassic()
487+
function WeakAuras.IsClassicOrCata()
488+
return WeakAuras.IsClassicEra() or WeakAuras.IsCataClassic()
489+
end
490+
491+
---@return boolean result
492+
function WeakAuras.IsClassicOrTBCOrWrathOrCata()
493+
return WeakAuras.IsClassicEra() or WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic()
494+
end
495+
496+
---@return boolean result
497+
function WeakAuras.IsClassicOrTBCOrWrathOrCataOrMists()
498+
return WeakAuras.IsClassicEra() or WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic() or WeakAuras.IsMists()
499+
end
500+
501+
---@return boolean result
502+
function WeakAuras.IsTBCOrWrathOrCata()
503+
return WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic()
484504
end
485505

486506
---@return boolean result
@@ -499,13 +519,23 @@ function WeakAuras.IsWrathOrCataOrMistsOrRetail()
499519
end
500520

501521
---@return boolean result
502-
function WeakAuras.IsClassicOrWrathOrCata()
503-
return WeakAuras.IsClassicEra() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic()
522+
function WeakAuras.IsTBCOrWrathOrCataOrMists()
523+
return WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic() or WeakAuras.IsMists()
524+
end
525+
526+
---@return boolean result
527+
function WeakAuras.IsWrathOrMists()
528+
return WeakAuras.IsWrathClassic() or WeakAuras.IsMists()
504529
end
505530

506531
---@return boolean result
507-
function WeakAuras.IsClassicOrWrathOrCataOrMists()
508-
return WeakAuras.IsClassicEra() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic() or WeakAuras.IsMists()
532+
function WeakAuras.IsTBCOrWrathOrMists()
533+
return WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsMists()
534+
end
535+
536+
---@return boolean result
537+
function WeakAuras.IsMistsOrRetail()
538+
return WeakAuras.IsMists() or WeakAuras.IsRetail()
509539
end
510540

511541
---@return boolean result
@@ -514,22 +544,28 @@ function WeakAuras.IsWrathOrMistsOrRetail()
514544
end
515545

516546
---@return boolean result
517-
function WeakAuras.IsWrathOrMists()
518-
return WeakAuras.IsWrathClassic() or WeakAuras.IsMists()
547+
function WeakAuras.IsTBCOrWrathOrMistsOrRetail()
548+
return WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsMists() or WeakAuras.IsRetail()
519549
end
520550

521551
---@return boolean result
522-
function WeakAuras.IsWrathOrRetail()
523-
return WeakAuras.IsWrathClassic() or WeakAuras.IsRetail()
552+
function WeakAuras.IsCataOrMists()
553+
return WeakAuras.IsCataClassic() or WeakAuras.IsMists()
524554
end
525555

526556
---@return boolean result
527-
function WeakAuras.IsTWW()
528-
return WeakAuras.BuildInfo >= 110000
557+
function WeakAuras.IsCataOrMistsOrRetail()
558+
return WeakAuras.IsCataClassic() or WeakAuras.IsMists() or WeakAuras.IsRetail()
529559
end
530560

531-
function WeakAuras.IsMidnight()
532-
return WeakAuras.BuildInfo >= 120000
561+
---@return boolean result
562+
function WeakAuras.IsTBCOrWrathOrCataOrMistsOrRetail()
563+
return WeakAuras.IsTBC() or WeakAuras.IsWrathClassic() or WeakAuras.IsCataClassic() or WeakAuras.IsMists() or WeakAuras.IsRetail()
564+
end
565+
566+
---@return boolean result
567+
function WeakAuras.IsWrathOrRetail()
568+
return WeakAuras.IsWrathClassic() or WeakAuras.IsRetail()
533569
end
534570

535571
---@param ... string

WeakAuras/Modernize.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ function Private.Modernize(data, oldSnapshot)
20152015
end
20162016

20172017
if data.internalVersion < 72 then
2018-
if WeakAuras.IsClassic() then
2018+
if WeakAuras.IsClassicEra() then
20192019
if data.model_path and data.modelIsUnit then
20202020
data.model_fileId = data.model_path
20212021
end
@@ -2468,7 +2468,7 @@ function Private.Modernize(data, oldSnapshot)
24682468
end
24692469

24702470
if data.internalVersion < 88 then
2471-
if WeakAuras.IsWrathClassic() then
2471+
if WeakAuras.IsTBCOrWrath() then
24722472
for _, triggerData in ipairs(data.triggers) do
24732473
local trigger = triggerData.trigger
24742474
if trigger and trigger.event == "Talent Known" and trigger.talent then

0 commit comments

Comments
 (0)