[ENHANCEMENT] Rework how hot reloading behaves - #7921
Open
nykwono wants to merge 1 commit into
Open
Conversation
Co-Authored-By: ComedyLost <106041578+ComedyLost@users.noreply.github.com>
Contributor
|
ENHANCMENET |
Contributor
Author
it was 3am when i made this PR I call this harassment 🥀 🥀 🥀 🥀 🥀 🥀 |
Member
|
I'll review this more thoroughly later but it seems well thought out |
4 tasks
AbnormalPoof
force-pushed
the
preview/public-playtest
branch
from
August 20, 2026 03:25
401b06b to
2e7f104
Compare
Hundrec
force-pushed
the
preview/public-playtest
branch
from
August 21, 2026 09:53
fff3525 to
25ad66b
Compare
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 issues:
Funkin#7915
Right now hot-reloading behaves really finicky as it simply just loads the state's constructor.
Because of this, there are a couple bugs like:
This PR reworks how hot-reloading is handled, attempting to give states more control of its behavior by:
HotReloadStateis now initialized given aHotReloadStateParamsobject containing:onCompletecallback for after hot-reloading is finished.targetStatefor the state to go to after finishing (Defaults to the state's constructor).If
targetStateis null, it'll first assume thatonCompleteis the one handling state switching, else it fallbacks to going back to the TitleState.onPreHotReload(),onPostHotReload(), &getHotReloadParamsonPreHotReload()is called right before hot-reloading begins, allowing states to save any necessary information needed.onPostHotReload()is called right after hot-reloading is finished andcreate()is called when the state is initialized.getHotReloadParams()is a function that states can override incase they have a specific way they want to hot-reload (For ex. PlayState doesn't usetargetStateto hot-reload and instead utilizesonComplete()to switch back.)With this rework, the above issues are fixed and you're now able to go into a chart and playtest it with it saving.
Courtesy of @ComedyLost for helping with fixing this issue!