if optimize mode is on, then remove assets and free memory

This commit is contained in:
KadeDeveloper
2021-08-13 17:20:55 -07:00
parent c3020d9dff
commit 5eb3a66b0c
9 changed files with 49 additions and 0 deletions

View File

@@ -209,6 +209,7 @@ class PauseSubState extends MusicBeatSubstate
{
var daSelected:String = menuItems[curSelected];
switch (daSelected)
{
case "Resume":
@@ -221,6 +222,7 @@ class PauseSubState extends MusicBeatSubstate
PlayState.instance.remove(PlayState.instance.videoSprite);
PlayState.instance.removedVideo = true;
}
PlayState.instance.clean();
FlxG.resetState();
case "Exit to menu":
PlayState.startTime = 0;
@@ -247,6 +249,8 @@ class PauseSubState extends MusicBeatSubstate
if (FlxG.save.data.fpsCap > 290)
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
PlayState.instance.clean();
if (PlayState.isStoryMode)
FlxG.switchState(new StoryMenuState());
else