mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-27 09:13:18 +00:00
tighten main menu security to prevent weird crashes during transitions
This commit is contained in:
parent
b7a76bdc8e
commit
9085eed598
|
@ -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);
|
||||
|
|
|
@ -24,7 +24,8 @@ class MenuTypedList<T:MenuItem> extends FlxTypedGroup<T>
|
|||
|
||||
var byName = new Map<String, T>();
|
||||
/** 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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue