Fix player panel layout, and filter UNIT_AURA to the target unit - #2
Open
rousseauxy wants to merge 2 commits into
Open
Fix player panel layout, and filter UNIT_AURA to the target unit#2rousseauxy wants to merge 2 commits into
rousseauxy wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BeledarOrchprotocol so a player can take part without installing Beledar Orchestra, and which disables itself when your addon is loaded. It was originally adapted from yourPlayerUI.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_AURAwas registered unfilteredframe: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 buttargetwith 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
titlewas anchoredTOPandversionTextTOPLEFTat 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 32pxUIPanelCloseButtonpinned to the frame'sTOPRIGHT, 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*keyUpdatePlayerPanelwrites to is unchanged.Testing. Both verified in-game on 0.4.30: no Lua errors, panel renders correctly, and
/conductor measure 7with the flame targeted drivesValidateTargetcorrectly — 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.