diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index bdcbd277c..abfc753aa 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -218,6 +218,7 @@ class MainMenuState extends MusicBeatState function startExitState(state:FlxState) { + menuItems.enabled = false; // disable for exit var duration = 0.4; menuItems.forEach(function(item) { @@ -241,7 +242,10 @@ class MainMenuState extends MusicBeatState FlxG.sound.music.volume += 0.5 * FlxG.elapsed; } - if (menuItems.enabled && controls.BACK) + if (_exiting) + menuItems.enabled = false; + + if (controls.BACK && menuItems.enabled && !menuItems.busy) FlxG.switchState(new TitleState()); super.update(elapsed); diff --git a/source/ui/MenuList.hx b/source/ui/MenuList.hx index 6d20d7d82..cee2f78b4 100644 --- a/source/ui/MenuList.hx +++ b/source/ui/MenuList.hx @@ -24,7 +24,8 @@ class MenuTypedList extends FlxTypedGroup var byName = new Map(); /** Set to true, internally to disable controls, without affecting vars like `enabled` */ - var busy:Bool = false; + public var busy(default, null):Bool = false; + // bit awkward because BACK is also a menu control and this doesn't affect that public function new (navControls:NavControls = Vertical, ?wrapMode:WrapMode) {