[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423
Open
maxzaleski wants to merge 5 commits into
Open
[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423maxzaleski wants to merge 5 commits into
maxzaleski wants to merge 5 commits into
Conversation
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.
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. |
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.
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
CooldownFrameTemplateframe 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.SetSwipeColor, so WHITE8X8 is used as the swipe texture and tinted to the user's chosen colour. Colour must also be re-applied after everySetCooldownFromDurationObjectcall, as that resets both the texture and colour.CooldownFrameitself. WoW seems to draws the cooldown swipe before standard textures on the same frame, so a BACKGROUND texture directly on theCooldownFramerenders above the sweep and obscures it.Important
Please note that when
ShowClockBorderis 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
CooldownFrameTemplateis 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
UnitCastingInfotimestamps and doing the arithmetic in Lua is not viable as these are now secret values. I managed to circumvent this by usingSetCooldownFromDurationObjectinstead (a bit hacky but works nonetheless).Font size and colour are user-configurable. The internal
FontStringinside theCooldownFrameis not exposed via a named method, so it is discovered once at creation time viaGetRegions()and stored as_timerCdFSfor later use inStyleIcon.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
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 theSetting()helper returns the declared default when a key is nil, so no migration logic is needed.Screenshots
Settings
Stills from demo video