mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 04:00:02 +00:00
actionbar: make use of hook functions
This commit is contained in:
+10
-32
@@ -4,35 +4,15 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
default_border = C.appearance.border.actionbars
|
||||
end
|
||||
|
||||
-- override wow ui functions
|
||||
function _G.ActionButton_ShowGrid(button)
|
||||
if not button then button = this end
|
||||
button.showgrid = button.showgrid + 1
|
||||
button:Show()
|
||||
end
|
||||
hooksecurefunc("MultiActionBar_ShowAllGrids", function()
|
||||
MultiActionBar_UpdateGrid("BonusAction", 1)
|
||||
MultiActionBar_UpdateGrid("Action", 1)
|
||||
end)
|
||||
|
||||
function _G.ActionButton_HideGrid(button)
|
||||
if not button then button = this end
|
||||
button.showgrid = button.showgrid - 1
|
||||
|
||||
if button.showgrid == 0 and not HasAction(ActionButton_GetPagedID(button)) then
|
||||
button:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function _G.MultiActionBar_ShowAllGrids()
|
||||
for _, bar in pairs({ "MultiBarBottomLeft", "MultiBarBottomRight",
|
||||
"MultiBarRight", "MultiBarLeft", "BonusAction", "Action" }) do
|
||||
MultiActionBar_UpdateGrid(bar, 1)
|
||||
end
|
||||
end
|
||||
|
||||
function _G.MultiActionBar_HideAllGrids()
|
||||
for _, bar in pairs({ "MultiBarBottomLeft", "MultiBarBottomRight",
|
||||
"MultiBarRight", "MultiBarLeft", "BonusAction", "Action" }) do
|
||||
MultiActionBar_UpdateGrid(bar)
|
||||
end
|
||||
end
|
||||
hooksecurefunc("MultiActionBar_HideAllGrids", function()
|
||||
MultiActionBar_UpdateGrid("BonusAction")
|
||||
MultiActionBar_UpdateGrid("Action")
|
||||
end)
|
||||
|
||||
hooksecurefunc("ShowBonusActionBar", function()
|
||||
if pfActionBar then pfActionBar:Hide() end
|
||||
@@ -600,10 +580,8 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
button:SetHeight(C.bars.icon_size)
|
||||
button:Show()
|
||||
|
||||
local texture = _G[actionbutton..i..'NormalTexture']
|
||||
texture:SetAlpha(0)
|
||||
texture:SetAllPoints(button)
|
||||
texture:SetTexCoord(.08, .92, .08, .92)
|
||||
button:SetNormalTexture("")
|
||||
button.SetNormalTexture = function() return end
|
||||
|
||||
local icon = _G[actionbutton..i..'Icon']
|
||||
icon:SetAllPoints(button)
|
||||
|
||||
Reference in New Issue
Block a user