You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked the Issues/Discussions pages to see if my issue has already been reported
Platform
Compiled from GitHub Source Code
Browser
None
Version
0.5.2
Description (include any images, videos, errors, or crash logs)
in Module.hx...
/** * Called when a module is destroyed. * This currently only happens when reloading modules with F5.*/publicfunctiononDestroy(event:ScriptEvent) {}
but in PlayState.hx...
/** * Perform necessary cleanup before leaving the PlayState.*/functionperformCleanup():Void
{
// If the camera is being tweened, stop it.cancelAllCameraTweens();
// Dispatch the destroy event.dispatchEvent(newScriptEvent(DESTROY, false));
im assuming this is unintentional...
maybe these events should be unique to each other? it's been a bit of a hassle figuring out how to prevent what would be unrelated cleanup code from running when playstate is destroyed
currently im just doing this:
privatevarpressedReload:Bool=false; // just in case theres a single frame delayoverridepublicfunctiononUpdate(event:UpdateScriptEvent):Void {
pressedReload=FlxG.keys.justPressed.F5;
}
overridepublicfunctiononDestroy(event:ScriptEvent):Void {
if (
(PlayState.instance!=null&&PlayState.instance.criticalFailure) ||
(!FlxG.keys.justPressed.F5&&!pressedReload)
) {
return; // is not reloading
}
// reloading
}
Steps to Reproduce
trace during onDestroy in a module, it should show up in console when PlayState is destroyed as well as mod reload
The text was updated successfully, but these errors were encountered:
Issue Checklist
Platform
Compiled from GitHub Source Code
Browser
None
Version
0.5.2
Description (include any images, videos, errors, or crash logs)
in
Module.hx
...but in
PlayState.hx
...im assuming this is unintentional...
maybe these events should be unique to each other? it's been a bit of a hassle figuring out how to prevent what would be unrelated cleanup code from running when playstate is destroyed
currently im just doing this:
Steps to Reproduce
trace
duringonDestroy
in a module, it should show up in console whenPlayState
is destroyed as well as mod reloadThe text was updated successfully, but these errors were encountered: