Action bars: glow proc and reactive spells from ClassicAPI's overlay events

A button on the action bars pulses a gold border while the spell in its
slot glows: Overpower, Revenge, Execute, Riposte, Counterattack, Mongoose
Bite and Hammer of Wrath while usable, and Shadow Bolt under Shadow
Trance. The slot update resolves the spell, through GetMacroSpell for a
macro, and reads IsSpellOverlayed, so glows lit before a /reload show.
SPELL_ACTIVATION_OVERLAY_GLOW_SHOW/HIDE then update the buttons with that
spell ID; every rank fires its own event.

"Highlight Proc And Reactive Spells" under Action Bars turns it off.
The screen alerts are left out: their art isn't in the 1.12 client.
This commit is contained in:
Brues
2026-11-03 01:07:03 -06:00
parent 646174fc60
commit df7c13651b
4 changed files with 63 additions and 0 deletions
+1
View File
@@ -675,6 +675,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "oomcolor", ".2,.2,1,1")
pfUI:UpdateConfig("bars", nil, "showna", "1")
pfUI:UpdateConfig("bars", nil, "nacolor", ".3,.3,.3,1")
pfUI:UpdateConfig("bars", nil, "procglow", "1")
pfUI:UpdateConfig("bars", nil, "showequipped", "1")
pfUI:UpdateConfig("bars", nil, "eqcolor", ".2,.8,.2,.2")
pfUI:UpdateConfig("bars", nil, "shiftdrag", "1")
+1
View File
@@ -433,6 +433,7 @@ pfUI_translation["enUS"] = {
["Highlight Out Of Mana Spells"] = nil,
["Highlight New Items"] = nil,
["Highlight Out Of Range Spells"] = nil,
["Highlight Proc And Reactive Spells"] = nil,
["Highlight Settings That Require Reload"] = nil,
["Highlight Unusable Items"] = nil,
["Hold [Shift] to use item."] = nil,
+60
View File
@@ -424,6 +424,36 @@ pfUI:RegisterModule("actionbar", function ()
end
end
-- the pulsing border of a spell whose proc glow is lit
local function ButtonProcShow(self, glow)
if glow then
if not self.proc:IsShown() then
self.proc:Show()
self.proc.pulse:Play()
end
elseif self.proc:IsShown() then
self.proc.pulse:Stop()
self.proc:Hide()
end
end
-- the spell an action slot casts, directly or through a macro, and its
-- proc glow. The glow events name that spell.
local function ButtonProcUpdate(self)
local kind, id, spellid, _
if C.bars.procglow == "1" then
kind, id = GetActionInfo(self.id)
if kind == "spell" then
spellid = id
elseif kind == "macro" then
_, _, spellid = GetMacroSpell(id)
end
end
self.spellid = spellid
ButtonProcShow(self, spellid and IsSpellOverlayed(spellid))
end
local castable, autocast, token
local grid, sid, active, texture, _
local function ButtonSlotUpdate(self)
@@ -466,6 +496,8 @@ pfUI:RegisterModule("actionbar", function ()
else
self.macro:SetText("")
end
ButtonProcUpdate(self)
end
-- icon
@@ -710,6 +742,15 @@ pfUI:RegisterModule("actionbar", function ()
return
end
-- the spell whose glow started or ended; each rank has its own event
if event == "SPELL_ACTIVATION_OVERLAY_GLOW_SHOW" or event == "SPELL_ACTIVATION_OVERLAY_GLOW_HIDE" then
local glow = IsSpellOverlayed(arg1)
for _, button in pairs(buttoncache) do
if button.spellid == arg1 then ButtonProcShow(button, glow) end
end
return
end
-- refresh only specific slots
if event == "ACTIONBAR_SLOT_CHANGED" and arg1 and arg1 ~= 0 then
QueueSlot(arg1)
@@ -770,6 +811,8 @@ pfUI:RegisterModule("actionbar", function ()
for event in pairs(pet_events) do RegisterBarEvent(event) end
bars:RegisterEvent("ACTION_RANGE_CHECK_UPDATE")
bars:RegisterEvent("ACTION_USABLE_CHANGED")
bars:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW")
bars:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_HIDE")
-- refresh actionbar buttons on event
bars:SetScript("OnEvent", BarsEvent)
@@ -1080,6 +1123,23 @@ pfUI:RegisterModule("actionbar", function ()
f.active:SetAllPoints()
f.active:Hide()
-- proc glow
if bar ~= 11 and bar ~= 12 then
f.proc = CreateFrame("Frame", nil, f)
f.proc:SetBackdrop(backdrop_highlight)
f.proc:SetBackdropBorderColor(1,.8,.2,1)
f.proc:SetAllPoints()
f.proc:Hide()
f.proc.pulse = f.proc:CreateAnimationGroup()
f.proc.pulse:SetLooping("BOUNCE")
local fade = f.proc.pulse:CreateAnimation("Alpha")
fade:SetFromAlpha(1)
fade:SetToAlpha(.3)
fade:SetDuration(.5)
fade:SetSmoothing("IN_OUT")
end
-- add to buttoncache
buttoncache[id] = f
end
+1
View File
@@ -2326,6 +2326,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["bars"], T["Out Of Mana Color"], C.bars, "oomcolor", "color")
CreateConfig(U["bars"], T["Highlight Not Usable Spells"], C.bars, "showna", "checkbox")
CreateConfig(U["bars"], T["Not Usable Color"], C.bars, "nacolor", "color")
CreateConfig(U["bars"], T["Highlight Proc And Reactive Spells"], C.bars, "procglow", "checkbox")
CreateConfig(U["bars"], T["Lock Actionbars"], "UVAR", "LOCK_ACTIONBAR", "checkbox")
CreateConfig(U["bars"], T["Always Allow Drag Via Shift Key"], C.bars, "shiftdrag", "checkbox")