Skip to content

UnitFrames: add Mouseover option for Blizzard Aura Frames - #1169

Open
Trenchfoote wants to merge 1 commit into
EllesmereGaming:mainfrom
Trenchfoote:feat/player-auras-mouseover
Open

UnitFrames: add Mouseover option for Blizzard Aura Frames#1169
Trenchfoote wants to merge 1 commit into
EllesmereGaming:mainfrom
Trenchfoote:feat/player-auras-mouseover

Conversation

@Trenchfoote

@Trenchfoote Trenchfoote commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a "Mouseover" toggle to Unit Frames -> Blizzard Aura Frames (Player Buffs &
Debuffs). When enabled, the buff and debuff frames stay hidden and each one
reveals only while the cursor is over its icons. Buffs and debuffs are
independent, so hovering one does not reveal the other.

Defaults off, applies live with no reload, and works whether or not the
styled-aura skin ("Enable Styled Buffs & Debuffs") is turned on -- which is why
the toggle sits outside that section gate.

How was it tested?

Tested in game on both clients -- live retail (12.0) and the 12.1 PTR. Same addon
build on each.

Toggled on/off: frames hide, reveal per-frame on hover, tooltips still work while
faded, and both return to full alpha when the setting is turned off. No load
errors on either client.

Screenshots

Adding before/after shortly.

Checklist

  • New settings default OFF (no behavior change without opt-in)
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no frames built
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames
  • Tested in-game, works on live retail; no load errors on the 12.1 PTR client

Notes for review

Driven by the aura buttons' own OnEnter/OnLeave rather than a ticker: an
alpha-0 frame still receives mouse input, so the buttons keep their tooltips and
keep firing while invisible. The fade-out defers one frame and re-tests which
button is hovered, so sliding between icons does not flicker.

Hover is tested against the buttons, never the parent frame -- BuffFrame's rect
extends well past the visible icons (Edit Mode region, expand button,
consolidation frame), so frame:IsMouseOver() stays true long after the cursor
has left the auras.

Nothing exists until first enable: no frame, no event registration, no hooks.
Buttons are hooked on a deferred sweep off player UNIT_AURA, skipping
already-hooked buttons via the ffd weak table.

Touches the player aura frames but adds no IS_121 branch -- it uses the same
frame.auraFrames / AuraContainer accessors the existing skin path already
uses ungated. Flagging it in case you want that gated differently.

Adds a Mouseover toggle to the Player Buffs & Debuffs options. When on,
BuffFrame and DebuffFrame stay hidden and each reveals only while the cursor
is over its icons. Buffs and debuffs are independent, so hovering one does not
reveal the other.

Driven by the aura buttons' own OnEnter/OnLeave rather than a ticker: an
alpha-0 frame still receives mouse input, so the buttons keep their tooltips
and keep firing while invisible. The fade-out defers one frame and then
re-tests which button is hovered, so sliding between icons does not flicker.
Hover is tested against the buttons and never the parent frame, whose rect
extends well beyond the visible icons.

Nothing is created until the setting is first enabled: no frame, no event
registration, no hooks. Defaults off, applies live with no reload, and works
whether or not the styled-aura skin is enabled.
Copilot AI review requested due to automatic review settings August 3, 2026 04:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Mouseover” behavior for Blizzard’s BuffFrame/DebuffFrame within the UnitFrames module, exposing it as an option in the Unit Frames UI and implementing the runtime fade/show logic in the PlayerAuras module.

Changes:

  • Adds a new “Mouseover” toggle to the Player Buffs & Debuffs options UI and wires it into the existing playerAuras option setter.
  • Implements mouseover-driven alpha fading for BuffFrame/DebuffFrame by hooking aura buttons’ OnEnter/OnLeave and sweeping for newly created buttons via UNIT_AURA.
  • Applies the mouseover behavior during PLAYER_LOGIN initialization (before the styled-skin enable gate).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
EllesmereUIUnitFrames/EUI_UnitFrames_Options.lua Adds a “Mouseover” toggle row for Blizzard aura frames and triggers the mouseover apply function on option updates.
EllesmereUIUnitFrames/EllesmereUIUnitFrames_PlayerAuras.lua Implements the mouseover fade/sweep logic and applies it during module initialization.
Suppressed comments (1)

EllesmereUIUnitFrames/EllesmereUIUnitFrames_PlayerAuras.lua:480

  • Mouseover hooking/sweeping is only driven by player UNIT_AURA, but elsewhere in this module Edit Mode preview is called out as a button-birth path without a UNIT_AURA. If the user opens Edit Mode after enabling Mouseover, the preview buttons can be unhooked and the frame alpha may not be re-settled until the next aura change. Consider queuing a sweep when Edit Mode opens (the handler already bails when mouseover is off).
        if not _moEvt then
            _moEvt = CreateFrame("Frame")
            _moEvt:SetScript("OnEvent", MO_QueueSweep)
        end
        _moEvt:RegisterUnitEvent("UNIT_AURA", "player")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +447 to +449
-- Buttons are only born from aura-list changes, so one deferred sweep per
-- player UNIT_AURA catches every new button. Already-hooked buttons are skipped
-- on the ffd flag, so the steady-state sweep walks a short list and does nothing.
@Trenchfoote

Copy link
Copy Markdown
Contributor Author
Discord_LaF4pdGDQ0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants