Skip to content

Commit

Permalink
Dynamically updating widgets when changing settings in spell list (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Sep 12, 2020
1 parent 2a33b4b commit 3e5e11e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2288,8 +2288,10 @@ end

function Aptechka.FrameSetJob(frame, opts, enabled, ...)
if opts and opts.assignto then
for slot in pairs(opts.assignto) do
AssignToSlot(frame, opts, enabled, slot, ...)
for slot, slotEnabled in pairs(opts.assignto) do
if slotEnabled then
AssignToSlot(frame, opts, enabled, slot, ...)
end
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions Options/SpellList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ function ns.CreateCommonForm(self)

-- remove clones of the previous version of the spell
local oldOriginalSpell = AptechkaConfigMerged[category][spellID]
-- Kill all jobs with the old settings
Aptechka:ForEachFrame(function(frame)
Aptechka.FrameSetJob(frame, oldOriginalSpell, false)
end)
if oldOriginalSpell and oldOriginalSpell.clones then
for i, additionalSpellID in ipairs(oldOriginalSpell.clones) do
AptechkaConfigMerged[category][additionalSpellID] = nil
Expand Down Expand Up @@ -265,6 +269,8 @@ function ns.CreateCommonForm(self)
AptechkaConfigMerged.spellClones[additionalSpellID] = true
end
end
-- Rescan all units' auras with new settings
Aptechka:ForEachFrame(Aptechka.FrameScanAuras)
----------

AptechkaConfigCustom[class] = AptechkaConfigCustom[class] or {}
Expand Down

0 comments on commit 3e5e11e

Please sign in to comment.