Skip to content

Keep the spell cooldown next to the pointer counting down - #27

Merged
tomluchowski merged 1 commit into
tomluchowski:shaders-improvementfrom
Upabjojr:split/spell-cooldown
Aug 1, 2026
Merged

Keep the spell cooldown next to the pointer counting down#27
tomluchowski merged 1 commit into
tomluchowski:shaders-improvementfrom
Upabjojr:split/spell-cooldown

Conversation

@Upabjojr

@Upabjojr Upabjojr commented Aug 1, 2026

Copy link
Copy Markdown

Selecting a spell still cooling down shows a countdown next to the pointer, but it was only rewritten on mouse move, so it froze whenever the mouse did — still showing a stale value once the spell was castable again. The countdown now keeps counting next to a resting pointer. One commit.


Split out of #16 so each topic can be reviewed on its own. Merging all of the split PRs reproduces the tree of #16 exactly.

🤖 Generated with Claude Code

Selecting a spell that is still cooling down puts a countdown next to the mouse
pointer, "CreatureExplosion (2.34 s)". It only moves while the mouse does, so
hovering an enemy waiting to explode it leaves the countdown reading whatever it
did when the mouse last stopped, and still reading it once the spell is castable
again.

The text is written by checkInputCommand(), which runs on mouse move and on
click. Everything else it displays depends on where the pointer is, so that was
enough; the cooldown is the one thing that changes while the player does
nothing. The value behind it is fine, Player::frameStarted() smooths it every
frame, and the progress bar over the spell icon follows it correctly.

Refresh the countdown every frame as well. The cooldown branch of
checkSpellCast() moves into checkSpellCooldown() so that both callers share it,
and because it is worth stating separately that this part displays and never
casts, whatever the input state is. Once the cooldown ends, the countdown has to
give way to whatever the spell puts there instead, which only the spell knows,
so checkSpellCast() is asked once. Not when the input state is validated, since
that is the state in which it casts the spell rather than describing it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 8a83239)
@tomluchowski

Copy link
Copy Markdown
Owner

Seems fine

@tomluchowski
tomluchowski merged commit 65c6249 into tomluchowski:shaders-improvement Aug 1, 2026
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