feat(raidframes): per-spec Target Unit / Context Menu via drag - #1243
Open
wanghwplus wants to merge 2 commits into
Open
feat(raidframes): per-spec Target Unit / Context Menu via drag#1243wanghwplus wants to merge 2 commits into
wanghwplus wants to merge 2 commits into
Conversation
Both are seeded into cc.globals at DB creation and cannot be deleted there, so their key was shared by every character on the account with no way to vary it per spec. Dragging one onto the Spec Bindings sidebar now copies it into the active spec, seeded from the global so it starts behaving identically and only has to be rebound. Deleting the copy falls straight back to the global. Resolution had to grow a type rule to match: GetActiveBindings de-duped on key alone, so moving a spec's Target Unit off Left Click left the global's Left Click still targeting -- the copy read as an addition, not an override. Both the shadow rule and the "is this binding in force" predicate are now single functions (GetShadowedTypes / BindingIsLive) that resolution, FindKeyConflicts and the options page all share, so a shadowed global can no longer be reported as a live keybind conflict or drawn as active while the spec copy fires. The drop suppresses the click the engine delivers with the drag's mouse-up (same reason the CDM icon reorder keeps a dragEndTime) and defers its rebuild a frame through ns._ccRebuild, so the page is never torn down from inside the handler the engine is still dispatching on. Nothing changes for anyone who does not drag: with no spec copies present the shadow set is empty and resolution is byte-for-byte what it was.
wanghwplus
force-pushed
the
hovercast-spec-target-menu-override
branch
from
August 7, 2026 07:50
ac84570 to
206aef2
Compare
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.
What does this PR do?
HoverCast's Target Unit and Context Menu are seeded into
cc.globalswhen the DB is created and cannot be deleted there.cclives atEllesmereUIDB.clickCast, which is account-global and deliberately stripped from profiles, so those two keys were shared by every character on the account with no way to vary them per spec - while every other binding type already had a per-spec path.Dragging a Target Unit / Context Menu tile from Global Bindings onto the Spec Bindings sidebar now copies it into the active spec. No new popup, no new button - if you never drag, the page is exactly what it was.
Resolution had to grow a type rule
GetActiveBindingsde-duped on key alone. Moving a spec's Target Unit off Left Click therefore left the global's Left Click still targeting, so the spec entry read as an addition rather than an override. Overridable types now shadow by type as well.Two predicates that this implies are single functions the whole file shares:
BindingIsLive(b)enabled ~= false and key)GetShadowedTypes()Resolution,
FindKeyConflictsand the options page all go through them, so a shadowed global can no longer be reported as a live keybind conflict, nor drawn as active while the spec copy is what fires. A spec copy whose key was cleared shadows nothing and every surface agrees on that.Drag mechanics
EllesmereUI.Mouse.SubscribeFrame(motionOnly), unsubscribed on drop - no bespoke OnUpdate.dragEndTime. Without it the drop re-selected the source tile and fired a second page rebuild from a tile the first rebuild had already orphaned.ns._ccRebuild(latest-wins), so the page is never torn down from inside the handler the engine is still dispatching on, and a stale closure can never drive the page singleton.Scope
Only
targetandmenuare overridable.dispel/external/trinket1/trinket2/dynamicrezare the same kind of non-deletable global singleton and the machinery is general enough to cover them - happy to extend if you want it, but I kept the diff to what was actually asked for.How was it tested?
Live retail 8.7.6, on the HoverCast page:
12.1 PTR: not tested. The change adds no
IS_121-gated paths and touches no aura rendering - it is plain Lua plus options-page UI - but I am not claiming PTR verification I did not do.Screenshots
Checklist
C_Timer.After(0).HookScript/hooksecurefunconly, neverSetScripton Blizzard frames - N/A, nothing here touches a Blizzard frame.SetScriptis used only on frames this file creates.