Fix leader icon not updating on first leader change - #9
Merged
Conversation
Owner
|
Thanks for the PR! This has been merged into main and will ship in the next build. Good catch on the |
DanderBot
added a commit
that referenced
this pull request
Feb 18, 2026
DanderBot
added a commit
that referenced
this pull request
Apr 10, 2026
Replaces the scaffolded stubs with the full cast-lifecycle
implementation. Debug output via DF:Debug("TARGETEDLIST", ...) is
used as a stand-in for visual bars until commit #5 lands the render
pipeline — this lets in-game verification happen against the debug
console without requiring the full rendering work first.
All 13 correctness gotchas from the TS3 cross-reference in
_Reference/targeted-spells-findings.md are handled and tagged inline:
#1 0.2s delay before reading cast data (start events fire before
UnitSpellTargetName / duration are populated)
#2 Cast-ID matching at both pickup (via UnitCastingInfo) and stop
(via event castGuid) — prevents rapid-restart flicker
#3 UNIT_SPELLCAST_SUCCEEDED during an active channel is treated
as a no-op (channel tick, not a stop)
#4 INTERRUPTED with nil interrupter or a dead caster is treated
as a normal stop (no interrupter flash)
#6 Empower spellId/castGuid offset handled (same shape as regular
start on current retail — documented inline)
#7 Interrupter lookup via UnitNameFromGUID / UnitClassFromGUID
#8 Uninterruptible flag from UnitCastingInfo/UnitChannelInfo is
treated as secret-tainted and only ever fed to
SetVertexColorFromBoolean (applied in commit #5)
#9 UNIT_SPELLCAST_INTERRUPTIBLE / NOT_INTERRUPTIBLE overwrite the
stored uninterruptible field with a clean boolean
#11 LOADING_SCREEN_DISABLED triggers a full release sweep
Also adds the cast-targeting filter pipeline:
* TargetedList_IsRelevantCaster filters out non-nameplate units,
friendly units, and party-member nameplates
* TargetedList_ReadCastData unifies UnitCastingInfo / UnitChannelInfo
read paths, handling the positional offset difference for
castID vs notInterruptible between the two APIs
* Important-spells filter via C_Spell.IsSpellImportant
* Hide-own-casts filter
* Roster name cache used for O(1) target lookup
Event dispatcher extended to route NAME_PLATE_UNIT_ADDED and
UNIT_TARGET through the start handler so new nameplates and mid-cast
target swaps are picked up. UNIT_TARGET also fires an immediate stop
to drop the old tracking — the 0.2s delayed re-pickup recreates it
if the new target is still a party member.
Content-type filter (gotcha #13) is intentionally deferred to
commit #5 since the existing TargetedSpells content-type detection
can be reused rather than duplicated.
Krathe82
pushed a commit
to Krathe82/DandersFrames
that referenced
this pull request
Jun 6, 2026
…ting Fix leader icon not updating on first leader change
Krathe82
pushed a commit
to Krathe82/DandersFrames
that referenced
this pull request
Jun 6, 2026
Krathe82
pushed a commit
to Krathe82/DandersFrames
that referenced
this pull request
Jun 6, 2026
Replaces the scaffolded stubs with the full cast-lifecycle
implementation. Debug output via DF:Debug("TARGETEDLIST", ...) is
used as a stand-in for visual bars until commit DanderBot#5 lands the render
pipeline — this lets in-game verification happen against the debug
console without requiring the full rendering work first.
All 13 correctness gotchas from the TS3 cross-reference in
_Reference/targeted-spells-findings.md are handled and tagged inline:
#1 0.2s delay before reading cast data (start events fire before
UnitSpellTargetName / duration are populated)
DanderBot#2 Cast-ID matching at both pickup (via UnitCastingInfo) and stop
(via event castGuid) — prevents rapid-restart flicker
DanderBot#3 UNIT_SPELLCAST_SUCCEEDED during an active channel is treated
as a no-op (channel tick, not a stop)
DanderBot#4 INTERRUPTED with nil interrupter or a dead caster is treated
as a normal stop (no interrupter flash)
DanderBot#6 Empower spellId/castGuid offset handled (same shape as regular
start on current retail — documented inline)
DanderBot#7 Interrupter lookup via UnitNameFromGUID / UnitClassFromGUID
DanderBot#8 Uninterruptible flag from UnitCastingInfo/UnitChannelInfo is
treated as secret-tainted and only ever fed to
SetVertexColorFromBoolean (applied in commit DanderBot#5)
DanderBot#9 UNIT_SPELLCAST_INTERRUPTIBLE / NOT_INTERRUPTIBLE overwrite the
stored uninterruptible field with a clean boolean
DanderBot#11 LOADING_SCREEN_DISABLED triggers a full release sweep
Also adds the cast-targeting filter pipeline:
* TargetedList_IsRelevantCaster filters out non-nameplate units,
friendly units, and party-member nameplates
* TargetedList_ReadCastData unifies UnitCastingInfo / UnitChannelInfo
read paths, handling the positional offset difference for
castID vs notInterruptible between the two APIs
* Important-spells filter via C_Spell.IsSpellImportant
* Hide-own-casts filter
* Roster name cache used for O(1) target lookup
Event dispatcher extended to route NAME_PLATE_UNIT_ADDED and
UNIT_TARGET through the start handler so new nameplates and mid-cast
target swaps are picked up. UNIT_TARGET also fires an immediate stop
to drop the old tracking — the 0.2s delayed re-pickup recreates it
if the new target is still a party member.
Content-type filter (gotcha DanderBot#13) is intentionally deferred to
commit DanderBot#5 since the existing TargetedSpells content-type detection
can be reused rather than duplicated.
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.
Problem
When creating a group (inviting someone) and then promoting them to leader, the crown icon stays stuck on the old leader's frame instead of moving to the new one.
Root Cause
The centralized
PARTY_LEADER_CHANGEDhandler inFrames/Headers.luauses aunitLeaderCachevariable to track the current leader and only update the affected frames (old + new leader). However,unitLeaderCacheis initialized asniland never populated until the first leader change occurs.On the first leader change:
oldLeader = nil(cache empty)frame.unit == oldLeadernever matches any frameFix
Added a
not oldLeaderguard to the update condition. When the cache is empty (first leader change), all frames are updated to ensure the crown is correctly removed from the previous leader. Once the cache is populated, subsequent leader changes continue to use the optimized path (only updating the two affected frames).This fixes: https://discord.com/channels/1443538945605636149/1470515656574370075