Keep the spell cooldown next to the pointer counting down - #27
Merged
tomluchowski merged 1 commit intoAug 1, 2026
Merged
Conversation
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)
Owner
|
Seems fine |
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.
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