diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 1551ec9..19248bc 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -40,6 +40,8 @@ class OptionsMenu extends MusicBeatState 'SongName', ]; var curSongBarOptionSelected:Int; + public static var onPlayState:Bool = false; + override function create() { #if desktop @@ -130,9 +132,17 @@ class OptionsMenu extends MusicBeatState if (controls.BACK) { + if(onPlayState) { + FlxG.save.flush(); + CompatTool.save.flush(); + LoadingState.loadAndSwitchState(new PlayState()); + FlxG.sound.music.volume = 0; + onPlayState = false; + } else { FlxG.save.flush(); CompatTool.save.flush(); FlxG.switchState(new MainMenuState()); + } } if (controls.UP_P) changeSelection(-1); diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index 2cfacc6..0a25df0 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -27,6 +27,7 @@ class PauseSubState extends MusicBeatSubstate new PauseOption('Restart Song'), new PauseOption('Change Character'), new PauseOption('No Miss Mode'), + new PauseOption('Options'), new PauseOption('Exit to menu') ]; var curSelected:Int = 0; @@ -133,7 +134,7 @@ class PauseSubState extends MusicBeatSubstate for (i in 0...menuItems.length) { - var songText:Alphabet = new Alphabet(0, (70 * i) + 30, LanguageManager.getTextString('pause_${menuItems[i].optionName}'), true, false); + var songText:Alphabet = new Alphabet(0, (70 * i) + 30, LanguageManager.getTextString('${menuItems[i].optionName}'), true, false); songText.isMenuItem = true; songText.targetY = i; grpMenuShit.add(songText); @@ -241,6 +242,14 @@ class PauseSubState extends MusicBeatSubstate PlayState.instance.health = 0; close(); } + case "Options": + if (MathGameState.failedGame) + { + MathGameState.failedGame = false; + } + PlayState.instance.vocals.volume = 0; + FlxG.switchState(new OptionsMenu()); + OptionsMenu.onPlayState = true; case "Exit to menu": if (MathGameState.failedGame) {