Skip to content

Commit

Permalink
fix for issue Boboseb#7 - openers on the primary action bar vanish
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottIngram committed Apr 8, 2023
1 parent b11264f commit 21aadd6
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions FloFlyout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function FloFlyout_OnLoad(self)
self:RegisterEvent("PLAYER_ALIVE")
self:RegisterEvent("UPDATE_BINDINGS")
self:RegisterEvent("ACTIONBAR_SLOT_CHANGED")
self:RegisterEvent("CURSOR_CHANGED")

EventRegistry:RegisterCallback("ActionBarShownSettingUpdated", function() FloFlyout:ApplyConfig() end , FloFlyout);

Expand Down Expand Up @@ -221,11 +222,47 @@ function FloFlyout_OnEvent(self, event, arg1, ...)

elseif event == "PLAYER_SPECIALIZATION_CHANGED" then
FloFlyout:ApplyConfig()

elseif event == "CURSOR_CHANGED" then
FloFlyout:FixOpenerStrata(arg1, ...)
else

end
end

function FloFlyout:FixOpenerStrata(isDefault, ...)
--local newCursorType, oldCursorType = ...
--print("-*-FixOpenerStrata-*- ... isDefault =",isDefault, "newCursorType =", newCursorType, "oldCursorType =", oldCursorType, "opener = ",opener)
if isDefault then
self:NormalizeOpenerStrata()
else
self:ElevateOpenerStrata()
end
end

function FloFlyout:ElevateOpenerStrata()
self:ApplyOperationToAllOpenerInstances(function(opener)
opener:SetFrameStrata("TOOLTIP")
end)
end

function FloFlyout:NormalizeOpenerStrata()
self:ApplyOperationToAllOpenerInstances(function(opener)
opener:SetFrameStrata("MEDIUM")
end)
end

function FloFlyout:ApplyOperationToAllOpenerInstances(callback)
for btnName, openerObj in pairs(self.openers) do
callback(openerObj, btnName)
end
end

function FloFlyout:ApplyOperationToAllOpenerInstancesUnlessInCombat(callback)
if InCombatLockdown() then return end
self:ApplyOperationToAllOpenerInstances(callback)
end

function FloFlyoutFrame_OnEvent(self, event, ...)
if event == "SPELL_UPDATE_COOLDOWN" then
local i = 1
Expand Down

0 comments on commit 21aadd6

Please sign in to comment.