actionbar: treat auto-repeat actions as active

This commit is contained in:
shagu
2019-06-13 18:34:59 +02:00
parent 52a4718b2f
commit 88cd6dcf86
+13 -22
View File
@@ -218,18 +218,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
local start, duration, enable
local castable, autocast, token
-- abort as early as possible on regular state update
if event == "ACTIONBAR_UPDATE_STATE" and not self.hide and self.bar ~= 11 and self.bar ~= 12 then
if IsCurrentAction(sid) then
self.backdrop:SetBackdropBorderColor(cr,cg,cb,1)
self.active:Show()
else
CreateBackdrop(self, border)
self.active:Hide()
end
return
end
-- set the own ID for compatibility to some vanilla addons
if pfUI.client <= 11200 then self:SetID(self.id) end
@@ -251,7 +239,7 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
usable, oom = true, nil
start, duration, enable = GetPetActionCooldown(sid)
else
active = IsCurrentAction(sid)
active = IsCurrentAction(sid) or IsAutoRepeatAction(sid)
texture = GetActionTexture(sid)
bar = GetActiveBar()
id = sid - ((self.bar == 1 and bar or self.bar)-1)*12
@@ -259,6 +247,18 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
start, duration, enable = GetActionCooldown(sid)
end
-- active border
if active then
self.backdrop:SetBackdropBorderColor(cr,cg,cb,1)
self.active:Show()
else
CreateBackdrop(self, border)
self.active:Hide()
end
-- abort as early as possible on regular state update
if event == "ACTIONBAR_UPDATE_STATE" then return end
-- handle secure action button templates (tbc+)
if self.SetAttribute then
if self.bar == 11 then
@@ -353,15 +353,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
end
-- active border
if active then
self.backdrop:SetBackdropBorderColor(cr,cg,cb,1)
self.active:Show()
else
CreateBackdrop(self, border)
self.active:Hide()
end
-- keybinds
if not self.hide and self.bar == 1 and self.bar ~= 11 and self.bar ~= 12 then
self.keybind:SetText(GetBindingText(GetBindingKey("ACTIONBUTTON"..id), "KEY_", 1))