fix: Fix the instrumental selector still allowing inputs after a song is selected
This commit is contained in:
@@ -22,6 +22,8 @@ class CapsuleOptionsMenu extends FlxSpriteGroup
|
||||
|
||||
var currentInstrumental:FlxText;
|
||||
|
||||
var busy:Bool = false;
|
||||
|
||||
public function new(parent:FreeplayState, x:Float = 0, y:Float = 0, instIds:Array<String>):Void
|
||||
{
|
||||
super(x, y);
|
||||
@@ -66,24 +68,34 @@ class CapsuleOptionsMenu extends FlxSpriteGroup
|
||||
destroy();
|
||||
return;
|
||||
}
|
||||
@:privateAccess
|
||||
if (parent.controls.BACK)
|
||||
var changedInst = false;
|
||||
|
||||
if (!busy)
|
||||
{
|
||||
close();
|
||||
return;
|
||||
@:privateAccess
|
||||
if (parent.controls.BACK)
|
||||
{
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (parent.getControls().UI_LEFT_P)
|
||||
{
|
||||
currentInstrumentalIndex = (currentInstrumentalIndex + 1) % instrumentalIds.length;
|
||||
changedInst = true;
|
||||
}
|
||||
if (parent.getControls().UI_RIGHT_P)
|
||||
{
|
||||
currentInstrumentalIndex = (currentInstrumentalIndex - 1 + instrumentalIds.length) % instrumentalIds.length;
|
||||
changedInst = true;
|
||||
}
|
||||
if (parent.getControls().ACCEPT)
|
||||
{
|
||||
busy = true;
|
||||
onConfirm(instrumentalIds[currentInstrumentalIndex] ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
var changedInst = false;
|
||||
if (parent.getControls().UI_LEFT_P)
|
||||
{
|
||||
currentInstrumentalIndex = (currentInstrumentalIndex + 1) % instrumentalIds.length;
|
||||
changedInst = true;
|
||||
}
|
||||
if (parent.getControls().UI_RIGHT_P)
|
||||
{
|
||||
currentInstrumentalIndex = (currentInstrumentalIndex - 1 + instrumentalIds.length) % instrumentalIds.length;
|
||||
changedInst = true;
|
||||
}
|
||||
if (!changedInst && currentInstrumental.text == '') changedInst = true;
|
||||
|
||||
if (changedInst)
|
||||
@@ -91,11 +103,6 @@ class CapsuleOptionsMenu extends FlxSpriteGroup
|
||||
currentInstrumental.text = instrumentalIds[currentInstrumentalIndex].toTitleCase() ?? '';
|
||||
if (currentInstrumental.text == '') currentInstrumental.text = 'Default';
|
||||
}
|
||||
|
||||
if (parent.getControls().ACCEPT)
|
||||
{
|
||||
onConfirm(instrumentalIds[currentInstrumentalIndex] ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
public function close():Void
|
||||
|
||||
Reference in New Issue
Block a user