Skip to content

[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423

Draft
maxzaleski wants to merge 11 commits into
EllesmereGaming:mainfrom
maxzaleski:raid-frames-enhancement-ts
Draft

[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423
maxzaleski wants to merge 11 commits into
EllesmereGaming:mainfrom
maxzaleski:raid-frames-enhancement-ts

Conversation

@maxzaleski

@maxzaleski maxzaleski commented Jun 21, 2026

Copy link
Copy Markdown

This PR introduces animated clock border and cast countdown timer for targeted spell icons. The former is a feature I enjoyed when Cell was still around (somewhat inspired), and the latter is a nice usability addition.

Both features are showcased here.

Note

While I have been tinkering with these features for a few days now, the landscape of targeted spells remains experimental. I would recommend spending a bit of time independently testing either feature to be somewhat confident with their stability. I have not encountered major downsides as of yet (degradation in performance, Lua errors, etc).

If a more informed maintainer could look at my API utilisation that would be helpful for future development. I have a couple more PRs to submit; I hope to be able to finish them in the coming days.

Summary Changes

Clock Border

A CooldownFrameTemplate frame is placed outside the icon edges by a configurable amount (default 3 px). The spell texture, rendered at a higher frame level, masks the interior such that only the outer ring is visible. The ring depletes clockwise as the cast drains, giving an immediate visual read on urgency without obscuring the icon.

  • The default pie-sweep texture ignores SetSwipeColor, so WHITE8X8 is used as the swipe texture and tinted to the user's chosen colour. Colour must also be re-applied after every SetCooldownFromDurationObject call, as that resets both the texture and colour.
  • The black background for the elapsed arc lives on a separate sibling Frame at frame level 2 rather than on the CooldownFrame itself. WoW draws the cooldown swipe before standard textures on the same frame, so a BACKGROUND texture directly on the CooldownFrame renders above the sweep and obscures it.

Important

When ShowClockBorder is enabled, the static pixel-perfect border (_borderFrame) is
hidden to avoid visual conflict with the ring.

UI Widgets

Toggle and colour swatch on the left, border size slider (1–10 px, default 3) on the
right. Per section (raid / party).


Cast Countdown Timer

A second CooldownFrameTemplate is placed over the icon with the swipe disabled and the built-in countdown numbers enabled. It shows the remaining cast time as a ticking number.

  • Reading UnitCastingInfo timestamps and doing the arithmetic in Lua is not viable as those values are secret. SetCooldownFromDurationObject passes the duration object directly to the C side, which handles all timing internally and never surfaces taint in Lua.
  • Font size and colour are user-configurable. The internal FontString inside theCooldownFrame is not exposed via a named method, so it is discovered once at creation time via GetRegions() and stored as _timerCdFS for later use in StyleIcon. The FontString is also re-anchored directly to the icon frame to bypass any pixel-snapping offset baked into the template.

UI Widgets

Duration Timer toggle shares a row with the Show Targeted Spells dropdown, with its colour swatch and cog popup (text size, X/Y offset) inline on the right. Icon Size and Icon Spacing share the row below. Per section (raid / party).

Screenshots

Settings bvbbbb
Stills from demo video CleanShot 2026-06-21 at 21 09 28@2x CleanShot 2026-06-21 at 21 09 07@2x

CooldownFrameTemplate placed 3 px outside the icon; the spell texture at a higher frame level masks the centre, leaving only the ring visible.

WHITE8X8 required as swipe texture — the default sweep ignores SetSwipeColor. Colour must be re-applied after SetCooldownFromDurationObject as that call resets it. Background moved to a sibling Frame at level -2; on the Cooldown frame itself it rendered above the sweep.

Colour configurable per section (raid / party).
Second CooldownFrameTemplate with swipe disabled and countdown enabled. UnitCastingInfo values are taint-secret — arithmetic throws in Lua, so the C side drives all timing internally via SetCooldownFromDurationObject.

FontString retrieved via GetRegions() at creation; SetFont used directly for size control. Clock Border and Timer controls merged onto one row in options; timer side includes a cog for size and position offsets.
…ion; rearrange TS options rows

Timer colour swatch was rendering at 0.4 alpha even when enabled — looked grey regardless of the chosen colour. Fixed to full opacity when active.

Added a Border Size slider (1–10, default 3) for the clock border. The pad was previously derived from icon size; now reads from a saved setting so it can be adjusted independently.

Options layout changed to two rows per section:
- Row 1: Clock Border toggle + colour swatch | Border Size slider
- Row 2: Show Duration Timer toggle + colour swatch + cog | empty

Applies to both raid and party sections.
Explains the sweeping animation behaviour on hover.
…iles

Both features defaulted to true, which would silently activate them for existing users on upgrade — including hiding the static PP border in favour of the clock ring. Changed defaults to false so neither feature activates unless explicitly enabled in the options.
@maxzaleski

maxzaleski commented Jun 21, 2026

Copy link
Copy Markdown
Author

From reviewing the footage, I'm realising now that the new border bleeds onto the "personal space" of sibling icons. I will push a new commit tomorrow aiming to allow the spacing between icons to be customised.

Edit (23/06): not had time to look into this just yet. Hoping to get this done in the next couple of days.

Added as part of 753a535. Additionally, preview now includes new settings.

@maxzaleski maxzaleski marked this pull request as draft June 23, 2026 18:27
PreviewTick only armed the face swipe; clock border and timer stayed hidden during preview regardless of their toggle state. Now arms both frames with the same random duration when their respective settings are enabled.
Spacing between icons was hardcoded at 2 px. Now reads from a setting (tsRaidIconSpacing / tsIconSpacing, default 2, range 0–20) so it can be adjusted per section without touching icon size.

Preview now places both icons on the same host frame so the spacing effect is visible while adjusting the slider. Previously they were spread across different unit frames, making the gap impossible to see in preview.
@maxzaleski maxzaleski force-pushed the raid-frames-enhancement-ts branch from fc99cd2 to 5021d92 Compare June 23, 2026 18:39
…ixel offset

CooldownFrameTemplate positions its countdown text relative to itself, accumulating any pixel-snapping error from parent frame sizing. Re-anchor _timerCdFS to the icon frame directly so the text is always centred on a clean boundary.
@maxzaleski maxzaleski force-pushed the raid-frames-enhancement-ts branch 3 times, most recently from 183f8e8 to 8c635e1 Compare June 24, 2026 10:53
… onto Show TS row

Moves the Duration Timer toggle onto the same row as Show Targeted Spells, with its colour swatch and cog popup inline on the right region. Icon Size and Icon Spacing share the row below.
Backwards compatibility: no existing settings are renamed or removed; layout change is cosmetic only.
Migration: no migration required.
Performance: no impact.
@maxzaleski maxzaleski force-pushed the raid-frames-enhancement-ts branch 3 times, most recently from 53a34c1 to 3af631e Compare June 24, 2026 16:17
…omDurationObject

SetCooldownFromDurationObject resets SetHideCountdownNumbers to its default (true),
same as it resets swipe colour. The flag was only set at frame creation so subsequent
uses from the icon pool, or any call that triggered the internal reset, would silently
suppress the countdown numbers. Re-applying false immediately after the call in both
ShowFor and PreviewTick ensures numbers always render when the timer is enabled.
…ch use

Clear() and SetCooldownFromDurationObject() both reset CooldownFrame drawing flags to template defaults. SetDrawSwipe was only set at creation time, so pool-reused icons (common when elite mobs die and respawn) could re-enable the black swipe overlay on _timerCd, hiding the countdown numbers. Re-apply SetDrawSwipe(false) immediately after SetCooldownFromDurationObject in ShowFor and after SetCooldown in PreviewTick, mirroring the SetHideCountdownNumbers re-application pattern.
@maxzaleski maxzaleski force-pushed the raid-frames-enhancement-ts branch from 3af631e to bbfa462 Compare June 24, 2026 16:46
@maxzaleski

Copy link
Copy Markdown
Author

Paused for now. Exboss have come out with their own version of targeted spells; timers work where mine fall short.

Current state:

  • Cast timers are consistent with non-elite trash.
  • Cast timers are inconsistent on elite trash (e.g. in MT: Sentry's Ethereal Shackles won't work; Pyromancer's Pyroblast works)

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