mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 13:00:50 +00:00
actionbar: use generic hook mechanism
This commit is contained in:
+6
-21
@@ -34,32 +34,18 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Hook_ShowBonusActionBar then
|
pfUI.api.Hook("ShowBonusActionBar", function()
|
||||||
Hook_ShowBonusActionBar = ShowBonusActionBar
|
|
||||||
end
|
|
||||||
|
|
||||||
function ShowBonusActionBar()
|
|
||||||
if pfActionBar then pfActionBar:Hide() end
|
if pfActionBar then pfActionBar:Hide() end
|
||||||
if pfBonusBar then pfBonusBar:Show() end
|
if pfBonusBar then pfBonusBar:Show() end
|
||||||
Hook_ShowBonusActionBar()
|
end)
|
||||||
end
|
|
||||||
|
|
||||||
if not Hook_HideBonusActionBar then
|
pfUI.api.Hook("HideBonusActionBar", function()
|
||||||
Hook_HideBonusActionBar = HideBonusActionBar
|
|
||||||
end
|
|
||||||
|
|
||||||
function HideBonusActionBar()
|
|
||||||
if pfActionBar then pfActionBar:Show() end
|
if pfActionBar then pfActionBar:Show() end
|
||||||
if pfBonusBar then pfBonusBar:Hide() end
|
if pfBonusBar then pfBonusBar:Hide() end
|
||||||
Hook_HideBonusActionBar()
|
end)
|
||||||
end
|
|
||||||
|
|
||||||
if pfUI_config.bars.glowrange == "1" then
|
if pfUI_config.bars.glowrange == "1" then
|
||||||
if not Hook_ActionButton_OnUpdate then
|
pfUI.api.Hook("ActionButton_OnUpdate", function(elapsed)
|
||||||
Hook_ActionButton_OnUpdate = ActionButton_OnUpdate
|
|
||||||
end
|
|
||||||
|
|
||||||
function ActionButton_OnUpdate(elapsed)
|
|
||||||
-- Handle range indicator
|
-- Handle range indicator
|
||||||
if ( this.rangeTimer ) then
|
if ( this.rangeTimer ) then
|
||||||
this.rangeTimer = this.rangeTimer - elapsed
|
this.rangeTimer = this.rangeTimer - elapsed
|
||||||
@@ -75,8 +61,7 @@ pfUI:RegisterModule("actionbar", function ()
|
|||||||
this.rangeTimer = TOOLTIP_UPDATE_TIME
|
this.rangeTimer = TOOLTIP_UPDATE_TIME
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Hook_ActionButton_OnUpdate(elapsed)
|
end)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ActionButton_GetPagedID(button)
|
function ActionButton_GetPagedID(button)
|
||||||
|
|||||||
Reference in New Issue
Block a user