Skip to content

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

Open
maxzaleski wants to merge 5 commits into
EllesmereGaming:mainfrom
maxzaleski:raid-frames-enhancement-ts
Open

[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423
maxzaleski wants to merge 5 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 3 px outside the icon edges. 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 (frame level +2) rather than on the
    CooldownFrame itself. WoW seems to 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

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

UI Widgets

Toggle, colour swatch, and border size slider (1–10 px, default 3) 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.

  • The obvious approach of reading UnitCastingInfo timestamps and doing the arithmetic in Lua is not viable as these are now secret values. I managed to circumvent this by using SetCooldownFromDurationObject instead (a bit hacky but works nonetheless).

  • Font size and colour are user-configurable. The internal FontString inside the CooldownFrame 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.

UI Widgets

Toggle and colour swatch inline, with a cog popup for text size and X/Y offset. Clock Border and Timer controls share two rows in the options panel to keep the section compact.

Backwards Compatibility

I will include this section in all future PRs as it might save a comment or two.

Both features are fully opt-in with existing profiles are unaffected on upgrade. All new settings (ShowClockBorder, ClockBorderSize, ClockBorderColor, ShowTimer, TimerSize, TimerColor, TimerOffsetX, TimerOffsetY) are absent from existing profiles; it is my understanding that the Setting() helper returns the declared default when a key is nil, so no migration logic is needed.

Screenshots

Settings abc
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.

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