mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-12 06:54:41 -04:00
fix: Fix the instrumental selector still allowing inputs after a song is selected
This commit is contained in:
parent
3492d412c6
commit
0e0c4aeb77
1 changed files with 27 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue