feat(queue): make a delayed unit leap into its new slot (fixes #441) - #3216
Open
woahwhattheheck wants to merge 1 commit into
Open
feat(queue): make a delayed unit leap into its new slot (fixes #441)#3216woahwhattheheck wants to merge 1 commit into
woahwhattheheck wants to merge 1 commit into
Conversation
Delaying slid the avatar flatly along the queue to its new position, which reads as the whole row shuffling rather than as that one unit taking itself to the back. Carry each vignette's previous queue position across a re-render so an update can tell a backwards move from an ordinary shuffle forwards. Delaying is the only thing that sends a unit backwards through the current turn's queue, so that is the delay landing, and it now animates as an arc into the new slot. Other movement is untouched: units shuffling forward, insertions, deletions and the next-turn queue all animate exactly as before. fixes FreezingMoon#441
|
@woahwhattheheck is attempting to deploy a commit to the FreezingMoon Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #441
What it looked like before
When a unit delays, its vignette went through
CreatureVignette.animateUpdate(), which is a single flat keyframe:So the avatar slides sideways along the row into its new slot at the same time every other vignette is sliding the other way. It reads as the whole queue shuffling, rather than as that one unit taking itself to the back — which is what you actually did.
What this changes
reuseOldDomElements()already carries the old DOM element across a re-render, so it now carries the old queue position too, aspreviousQueuePosition.animateUpdate()uses that to tell a backwards move from an ordinary shuffle forwards, and animates the backwards case as an arc: up to a midpoint at half the duration, then down into the new slot.Delaying is the only thing that sends a unit backwards through the current turn's queue — everything else moves it forwards as units ahead of it act or die — so that check is specific to the delay without needing a new signal threaded through from the game.
Everything else is untouched: forward shuffles, insertions, deletions, the kill animation and the next-turn queue all animate exactly as before. Leap height is a single constant (
CONST.delayLeapHeightPx, 60px) if you want it higher or lower.Testing
Two cases added to the existing
src/__tests__/ui/queue.ts, using theElement.prototype.animatemock that's already set up there: delaying a unit produces exactly one arc animation, and a queue that merely shuffles forward produces none.It's an animation, so the real check is watching it — delay a unit and the avatar should hop into place rather than slide. If the arc is too tall or too fast for your taste that's the one constant.
Not posting a wallet address here; happy to sort that separately if this lands.