mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 02:16:02 +00:00
actionbar: add option for red glow range indicator
This commit is contained in:
@@ -26,6 +26,30 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
Hook_HideBonusActionBar()
|
||||
end
|
||||
|
||||
if pfUI_config.bars.glowrange == "1" then
|
||||
if not Hook_ActionButton_OnUpdate then
|
||||
Hook_ActionButton_OnUpdate = ActionButton_OnUpdate
|
||||
end
|
||||
|
||||
function ActionButton_OnUpdate(elapsed)
|
||||
-- Handle range indicator
|
||||
if ( this.rangeTimer ) then
|
||||
this.rangeTimer = this.rangeTimer - elapsed
|
||||
if ( this.rangeTimer <= 0.1 ) then
|
||||
if ( IsActionInRange( ActionButton_GetPagedID(this)) == 0 ) then
|
||||
getglobal(this:GetName() .. 'Icon'):SetVertexColor(1.0, 0.1, 0.1)
|
||||
getglobal(this:GetName() .. 'NormalTexture'):SetVertexColor(1.0, 0.1, 0.1)
|
||||
else
|
||||
getglobal(this:GetName() .. 'Icon'):SetVertexColor(1,1,1)
|
||||
getglobal(this:GetName() .. 'NormalTexture'):SetVertexColor(1,1,1)
|
||||
end
|
||||
this.rangeTimer = TOOLTIP_UPDATE_TIME
|
||||
end
|
||||
end
|
||||
Hook_ActionButton_OnUpdate(elapsed)
|
||||
end
|
||||
end
|
||||
|
||||
function ActionButton_GetPagedID(button)
|
||||
if ( button.isBonus and CURRENT_ACTIONBAR_PAGE == 1 ) then
|
||||
local offset = GetBonusBarOffset()
|
||||
|
||||
@@ -61,6 +61,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "raid", "debuffs_class", "0")
|
||||
pfUI:UpdateConfig("bars", nil, "icon_size", "24")
|
||||
pfUI:UpdateConfig("bars", nil, "background", "1")
|
||||
pfUI:UpdateConfig("bars", nil, "glowrange", "0")
|
||||
pfUI:UpdateConfig("bars", nil, "hide_time", "1")
|
||||
pfUI:UpdateConfig("bars", nil, "hide_bottom", "0")
|
||||
pfUI:UpdateConfig("bars", nil, "hide_bottomleft", "0")
|
||||
|
||||
@@ -727,6 +727,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui.bar = pfUI.gui:CreateConfigTab("ActionBar")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.bar, "Icon Size", pfUI_config.bars, "icon_size")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.bar, "Show actionbar backgrounds", pfUI_config.bars, "background", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.bar, "Use red icon as range indicator", pfUI_config.bars, "glowrange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.bar, "Seconds to wait until hide bars", pfUI_config.bars, "hide_time")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.bar, "Autohide bottom actionbar", pfUI_config.bars, "hide_bottom", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.bar, "Autohide bottomleft actionbar", pfUI_config.bars, "hide_bottomleft", "checkbox")
|
||||
|
||||
Reference in New Issue
Block a user