Skip to content

Add click-cast binding tooltip on unit frame hover - #13

Merged
DanderBot merged 1 commit into
DanderBot:mainfrom
riyuk:feature/binding-tooltip
Feb 22, 2026
Merged

Add click-cast binding tooltip on unit frame hover#13
DanderBot merged 1 commit into
DanderBot:mainfrom
riyuk:feature/binding-tooltip

Conversation

@riyuk

@riyuk riyuk commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

out of combat:

2026-02-19 23_15_03

infight:

2026-02-19 23_16_34

Problem

There's no way to see which spells are bound to which mouse buttons/keys without opening the click-casting UI.

Solution

Adds a separate tooltip that appears next to unit frames when hovering over party/raid members, showing all active click-cast bindings.

  • Spell names colored green (usable) or red (not usable)
  • Shows only matching bindings when holding Shift/Ctrl/Alt
  • Fixed sort order: Left, Middle, Right, Mouse 4+, keyboard
  • "Show Tooltips" checkbox in the Binds menu to toggle
  • Smart Res compatible (only show Res Spell when applicable)

Due to secret values spell usability and cooldown status are only displayed out of combat.

Bug fix

Fixed attempted to iterate a forbidden table error in click-casting Blizzard frame registration. The recursive frame traversal in FindHealthManaBars now correctly guards against forbidden tables using pcall(next) instead of pcall(pairs).
Reproducible by entering Rookery, engaging combat, and running out of the instance.
#11 didnt fix it sadly.

Also see: https://discord.com/channels/1443538945605636149/1465084670592024607

@riyuk
riyuk marked this pull request as draft February 19, 2026 03:10
@riyuk riyuk changed the title Add click-cast binding tooltip on unit frame hover [WIP] Add click-cast binding tooltip on unit frame hover Feb 19, 2026
@riyuk
riyuk marked this pull request as ready for review February 19, 2026 03:19
@riyuk riyuk changed the title [WIP] Add click-cast binding tooltip on unit frame hover Add click-cast binding tooltip on unit frame hover Feb 19, 2026

@DanderBot DanderBot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hey @riyuk, great work on this — the tooltip feature and the pcall(next) bug fix are both solid. I pushed a commit with some adjustments:

Settings moved to Display > Tooltips tab

Moved the enable toggle out of the click-casting UI and into the standard tooltip options page. This gives users:

  • Independent party/raid control (different settings per mode)
  • "Disable in Combat" toggle
  • Anchor mode (Game Default / Cursor / Unit Frame)
  • Anchor position + X/Y offset sliders

This matches how every other tooltip type in the addon works (frame, buff, debuff, defensive).

Convention cleanup

  • Added -- ============ BINDING TOOLTIP section header
  • Cached globals at file scope (string.format, table.insert, table.sort, math.ceil, InCombatLockdown, etc.)
  • Pre-allocated the lines table at file scope and switched to wipe(lines) — avoids a table allocation on every MODIFIER_STATE_CHANGED event
  • Renamed GetActiveModifiergetActiveModifier and BindingMatchesModbindingMatchesMod (local helpers use camelCase per project conventions)

The tooltip logic, secret value handling, Smart Res integration, and the pcall(next) fix are all untouched — just wrapped in the new settings plumbing.

@DanderBot
DanderBot merged commit 96258d4 into DanderBot:main Feb 22, 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
Add click-cast binding tooltip on unit frame hover
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.
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