From df7c13651bcfbf48e5ad8795f69639cd039013d2 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 2 Nov 2026 23:55:28 -0600 Subject: [PATCH] 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. --- api/config.lua | 1 + env/translations_enUS.lua | 1 + modules/actionbar.lua | 60 +++++++++++++++++++++++++++++++++++++++ modules/gui.lua | 1 + 4 files changed, 63 insertions(+) diff --git a/api/config.lua b/api/config.lua index 5ee3ead3..04da5a2c 100644 --- a/api/config.lua +++ b/api/config.lua @@ -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") diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index c8ac9ed2..7139f0de 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -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, diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 2784d249..7042dd5f 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -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 diff --git a/modules/gui.lua b/modules/gui.lua index fdb4ba89..f470615c 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -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")