Skip to content

Fix player panel layout, and filter UNIT_AURA to the target unit - #2

Open
rousseauxy wants to merge 2 commits into
samsbase:masterfrom
rousseauxy:fix/player-panel-and-unit-aura
Open

Fix player panel layout, and filter UNIT_AURA to the target unit#2
rousseauxy wants to merge 2 commits into
samsbase:masterfrom
rousseauxy:fix/player-panel-and-unit-aura

Conversation

@rousseauxy

Copy link
Copy Markdown

Hi — these came out of a refactor on a different addon, so some context first.

I maintain SecretChecklist, which ships a small BeledarHelper: a cut-down follower client that speaks your BeledarOrch protocol so a player can take part without installing Beledar Orchestra, and which disables itself when your addon is loaded. It was originally adapted from your PlayerUI.

While reviewing SecretChecklist I found two problems in that helper, checked the original, and they were here too — inherited, not introduced by me. Hence this PR. Both are small and independent.


1. UNIT_AURA was registered unfiltered

frame:RegisterEvent("UNIT_AURA") delivers every aura application, refresh, stack change and expiry on every unit in the player's unit table — party, raid, boss, nameplates — and the handler then discarded all but target with a Lua-side check. In a 20-man raid that is on the order of thousands of dispatches per encounter doing nothing.

RegisterUnitEvent("UNIT_AURA", "target") applies the same filter in C before dispatch, so the handler only runs for the unit you actually read stacks from. The Lua check becomes redundant and is removed.

No behaviour change.

2. Player panel title overlapped the version string

title was anchored TOP and versionText TOPLEFT at the same height, so at 260px wide "Beledar Assignment" reached the left edge and the two drew on top of each other. The close button was a 32px UIPanelCloseButton pinned to the frame's TOPRIGHT, which put most of it outside the 16px backdrop border.

Both now sit in a header strip that reserves its own space — title left, version right, flat close button inside it. Measure and slot share a row rather than stacking centred, and the emote button spans the panel, since it is the only control the player acts on. The panel is 15px shorter as a result.

Every ui.player* key UpdatePlayerPanel writes to is unchanged.


Testing. Both verified in-game on 0.4.30: no Lua errors, panel renders correctly, and /conductor measure 7 with the flame targeted drives ValidateTarget correctly — the Aura differences row shows all 40 slots outstanding, which is right for one player who has not emoted. The full group flow (countdown, PERFORMED messages, multi-player diffing) I could not test — no raid available — so that path is reasoned about rather than observed.

Happy to split, reword or drop either commit. There is a second PR for optional EllesmereUI skinning which builds on this branch; entirely separate concern, and no hard feelings if it is not something you want.

UNIT_AURA was registered unfiltered and then narrowed in Lua with
`if unit == "target"`. That means every aura application, refresh, stack change
and expiry on every party, raid, boss and nameplate unit entered the handler
only to be discarded -- on the order of thousands of dispatches per encounter
in a 20-man raid.

RegisterUnitEvent applies the same filter in C before dispatch, so the handler
runs only for the unit the addon actually reads stacks from. The Lua check is
removed as redundant.

No behaviour change.
Two layout defects in the player panel.

The title was anchored TOP and the version string TOPLEFT at the same height,
so at 260px wide "Beledar Assignment" reached the left edge and the two drew on
top of each other.

The close button was a 32px UIPanelCloseButton pinned to the frame's TOPRIGHT,
which put most of it outside the 16px backdrop border, hanging off the corner.

Both now sit in a header strip that reserves its own space: title left, version
right, and a flat close button sized to fit inside it. The measure and slot
lines share a row instead of stacking centred, and the emote button spans the
panel width -- it is the only control the player acts on.

The panel is 15px shorter as a result. No behaviour change; every ui.player*
key the update path writes to is unchanged.
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.

1 participant