Skip to content

Commit

Permalink
Mainline classic era compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Nov 16, 2021
1 parent 81fb714 commit 3794785
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 36 deletions.
5 changes: 3 additions & 2 deletions Aptechka-Classic.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 11307
## Interface: 11401
## Title: Aptechka
## Notes: Raid Frames
## Version: @project-version@
Expand All @@ -15,6 +15,7 @@
Libs\LibStub\LibStub.lua
Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
Libs\AceDB-3.0\AceDB-3.0.xml
Libs\LibClassicDurations\LibClassicDurations.xml
Libs\LibCombatLogHealth-1.0\LibCombatLogHealth-1.0.lua
Libs\LibCustomGlow\LibCustomGlow-1.0.xml
Libs\LibSharedMedia-3.0\lib.xml
Expand All @@ -31,7 +32,7 @@ Libs\LibClassicDurations\LibClassicDurations.xml

helpers.lua
config.lua
config.tbc.lua
config.classic.lua
Aptechka.lua
migrations.lua
frame.lua
Expand Down
77 changes: 43 additions & 34 deletions Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -365,37 +365,6 @@ function Aptechka.PLAYER_LOGIN(self,event,arg1)
LibClassicDurations:RegisterFrame(self)
UnitAura = LibClassicDurations.UnitAuraWrapper
Aptechka:UpdateSpellNameToIDTable()

local spellNameBasedCategories = { "traces" }
function Aptechka:UpdateSpellNameToIDTable()
local mergedConfig = AptechkaConfigMerged
local visited = {}

for _, catName in ipairs(spellNameBasedCategories) do
local category = mergedConfig[catName]
if category then
for spellID, opts in pairs(category) do
if not visited[opts] then
local lastRankID
local clones = opts.clones
if clones and next(clones)then
lastRankID = spellID
for sid in pairs(clones) do
if lastRankID < sid then
lastRankID = sid
end
end
else
lastRankID = spellID
end
helpers.AddSpellNameRecognition(lastRankID)

visited[opts] = true
end
end
end
end
end
end
if apiLevel <= 2 then
function Aptechka:SetClassicClickcastAttributes(f)
Expand Down Expand Up @@ -726,6 +695,11 @@ function Aptechka:GenerateMergedConfig()
config.GLOBAL = nil
config[class] = nil

if apiLevel == 1 then
Aptechka.spellNameToID = helpers.spellNameToID
Aptechka:UpdateSpellNameToIDTable()
end

-- Template application
helpers.UnwrapConfigTemplates(AptechkaConfigMerged.traces)
helpers.UnwrapConfigTemplates(AptechkaConfigMerged.auras)
Expand Down Expand Up @@ -1243,16 +1217,19 @@ function Aptechka:COMBAT_LOG_EVENT_UNFILTERED(event)
dstGUID, dstName, dstFlags, dstFlags2,
spellID, spellName, spellSchool, amount, overhealing, absorbed, critical = CombatLogGetCurrentEventInfo()
if enableTraceheals and bit_band(srcFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) == COMBATLOG_OBJECT_AFFILIATION_MINE then
local traceSpellID -- separate var so it wouldn't interfere with aura events below
if spellID == 0 then
spellID = spellNameToID[spellName]
traceSpellID = spellNameToID[spellName]
else
traceSpellID = spellID
end
local opts = traceheals[spellID]
local opts = traceheals[traceSpellID]
if opts and eventType == "SPELL_HEAL" then
if guidMap[dstGUID] and not opts.disabled then
local minamount = opts.minamount
if not minamount or amount > minamount then
local unit = guidMap[dstGUID]
Aptechka:ForEachUnitFrame(unit, FrameStartTrace, opts, spellID)
Aptechka:ForEachUnitFrame(unit, FrameStartTrace, opts, traceSpellID)
end
end
end
Expand Down Expand Up @@ -2914,6 +2891,38 @@ local function SetDebuffIcon(frame, unit, index, debuffType, expirationTime, dur
end

if apiLevel == 1 then
local spellNameBasedCategories = { "traces" }
function Aptechka:UpdateSpellNameToIDTable()
local mergedConfig = AptechkaConfigMerged
local visited = {}

for _, catName in ipairs(spellNameBasedCategories) do
local category = mergedConfig[catName]
if category then
for spellID, opts in pairs(category) do
if not visited[opts] then
local lastRankID
local clones = opts.clones
if clones and next(clones)then
lastRankID = spellID
for sid in pairs(clones) do
if lastRankID < sid then
lastRankID = sid
end
end
else
lastRankID = spellID
end
helpers.AddSpellNameRecognition(lastRankID)

visited[opts] = true
end
end
end
end
end


SetDebuffIcon = function (frame, unit, index, debuffType, expirationTime, duration, icon, count, isBossAura, spellID, spellName)
local iconFrame = frame.debuffIcons[index]
if debuffType == false then
Expand Down

0 comments on commit 3794785

Please sign in to comment.