1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-21 22:33:26 +00:00

Fix window not closing when specified

This commit is contained in:
Victor G 2024-10-05 21:24:24 +02:00 committed by GitHub
parent bc546e86aa
commit 0d60929f18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -271,7 +271,7 @@ class TitleState extends MusicBeatState
#if desktop
if (FlxG.keys.justPressed.ESCAPE)
{
Sys.exit(0);
openfl.Lib.application.window.close();
}
#end

View file

@ -61,6 +61,12 @@ class CrashHandler
{
trace('Error while handling crash: ' + e);
}
#if sys
Sys.sleep(1); // wait a few moments of margin to process.
// Exit the game. Since it threw an error, we use a non-zero exit code.
openfl.Lib.application.window.close();
#end
}
static function onCriticalError(message:String):Void
@ -83,8 +89,9 @@ class CrashHandler
}
#if sys
Sys.sleep(1); // wait a few moments of margin to process.
// Exit the game. Since it threw an error, we use a non-zero exit code.
Sys.exit(1);
openfl.Lib.application.window.close();
#end
}