[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423
Draft
maxzaleski wants to merge 11 commits into
Draft
[RaidFrames] animated clock border and cast countdown timer for targeted spell icons#423maxzaleski wants to merge 11 commits into
maxzaleski wants to merge 11 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.
Added as part of 753a535. Additionally, preview now includes new settings. |
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.
fc99cd2 to
5021d92
Compare
…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.
183f8e8 to
8c635e1
Compare
… 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.
53a34c1 to
3af631e
Compare
…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.
3af631e to
bbfa462
Compare
Author
|
Paused for now. Exboss have come out with their own version of targeted spells; timers work where mine fall short. Current state:
|
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 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.SetSwipeColor, soWHITE8X8is 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.Frameat frame level 2 rather than on theCooldownFrameitself. WoW draws the cooldown swipe before standard textures on the same frame, so aBACKGROUNDtexture directly on theCooldownFramerenders above the sweep and obscures it.Important
When
ShowClockBorderis enabled, the static pixel-perfect border (_borderFrame) ishidden 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
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.UnitCastingInfotimestamps and doing the arithmetic in Lua is not viable as those values are secret.SetCooldownFromDurationObjectpasses the duration object directly to the C side, which handles all timing internally and never surfaces taint in Lua.FontStringinside theCooldownFrameis not exposed via a named method, so it is discovered once at creation time viaGetRegions()and stored as_timerCdFSfor later use inStyleIcon. TheFontStringis 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
Stills from demo video