-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[P3] Fix persisting sleep animation when sprite is already loaded #4562
Conversation
Ensure that a Pokémon's animation speed is reset properly after saving and quitting. Previously, if a Pokémon was put to sleep, which slows its framerate, saving and quitting would result in the slower framerate persisting even though the Pokémon was no longer asleep. This fix adds an else condition to reset the frameRate to 12 if the sprite is already loaded upon resuming the game. Fixes pagefaultgames#4465
d5ffe03
to
1a80ad9
Compare
Seems like a straightforward response to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, fps is reset. video
Are there any cases where the framerate is not 12? I referenced this code when getting rid of the effects of sleep. |
Also, if you happen to know which part of the code causes the framerate reduction, it'd save me a fair bit of time looking for it. |
|
Great question, and I suppose the easy answer is previously, when it was reduced by a member of the Species being Asleep. (Since the code is in PokeRogue.2024-10-03.16-13-55.mp4PokeRogue.2024-10-03.16-14-19.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, lgtm
PokeRogue.2024-10-03.16-03-56.mp4
That's really interesting given the statement in the Issue, if the actual code should only be setting framerate to a flat
(the reason I had to ask is in fact because it seemed like it wasn't getting slower upon repeated attempts) |
I was also unable to see the compounding in my testing. I used DevTools to track the framerate changes. |
What are the changes the user will see?
Pokémon animation speeds will function normally after reloading a session that was saved when an enemy Pokémon was asleep.
Why am I making these changes?
Fixes #4465
What are the changes from a developer perspective?
Calling PokemonSpeciesForm.loadAssets will reset the framerate when previously nothing would be done if the sprite was already loaded.
Screenshots/Videos
Before:
before.mp4
After:
after.mp4
How to test the changes?
Checklist
beta
as my base branch[ ] Have I considered writing automated tests for the issue?[ ] If I have text, did I make it translatable and add a key in the English locale file(s)?npm run test
)