Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Disable input in CharSelect until stayFunky plays #3355

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions source/funkin/ui/charSelect/CharSelectSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class CharSelectSubState extends MusicBeatSubState
var availableChars:Map<Int, String> = new Map<Int, String>();
var pressedSelect:Bool = false;
var selectTimer:FlxTimer = new FlxTimer();
var allowInput:Bool = false;

var selectSound:FunkinSound;
var unlockSound:FunkinSound;
Expand Down Expand Up @@ -430,6 +431,8 @@ class CharSelectSubState extends MusicBeatSubState
overrideExisting: true,
restartTrack: true,
onLoad: function() {
allowInput = true;

@:privateAccess
gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1);
#if desktop
Expand Down Expand Up @@ -573,6 +576,8 @@ class CharSelectSubState extends MusicBeatSubState
overrideExisting: true,
restartTrack: true,
onLoad: function() {
allowInput = true;

@:privateAccess
gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1);
#if desktop
Expand Down Expand Up @@ -642,6 +647,7 @@ class CharSelectSubState extends MusicBeatSubState

function goToFreeplay():Void
{
allowInput = false;
autoFollow = false;

FlxTween.tween(cursor, {alpha: 0}, 0.8, {ease: FlxEase.expoOut});
Expand Down Expand Up @@ -695,7 +701,7 @@ class CharSelectSubState extends MusicBeatSubState

syncAudio(elapsed);

if (!pressedSelect)
if (allowInput && !pressedSelect)
{
if (controls.UI_UP) holdTmrUp += elapsed;
if (controls.UI_UP_R)
Expand Down Expand Up @@ -789,7 +795,7 @@ class CharSelectSubState extends MusicBeatSubState
gfChill.visible = true;
curChar = availableChars.get(getCurrentSelected());

if (!pressedSelect && controls.ACCEPT)
if (allowInput && !pressedSelect && controls.ACCEPT)
{
cursorConfirmed.visible = true;
cursorConfirmed.x = cursor.x - 2;
Expand Down Expand Up @@ -817,7 +823,7 @@ class CharSelectSubState extends MusicBeatSubState
});
}

if (pressedSelect && controls.BACK)
if (allowInput && pressedSelect && controls.BACK)
{
cursorConfirmed.visible = false;
grpCursors.visible = true;
Expand Down Expand Up @@ -847,7 +853,7 @@ class CharSelectSubState extends MusicBeatSubState

gfChill.visible = false;

if (controls.ACCEPT)
if (allowInput && controls.ACCEPT)
{
cursorDenied.visible = true;
cursorDenied.x = cursor.x - 2;
Expand Down