Skip to content

[BUGFIX] Fix Latency State Exiting to Main Menu Instead of Options Menu #5076

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion source/funkin/ui/debug/latency/LatencyState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class LatencyState extends MusicBeatSubState
{
// close();
cleanup();
FlxG.switchState(() -> new MainMenuState());
FlxG.switchState(() -> new funkin.ui.options.OptionsState());
}

super.update(elapsed);
Expand Down
5 changes: 5 additions & 0 deletions source/funkin/ui/options/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class OptionsState extends MusicBeatState
{
var optionsCodex:Codex<OptionsMenuPageName>;

public static var rememberedSelectedIndex:Int = 0;

override function create():Void
{
persistentUpdate = true;
Expand Down Expand Up @@ -93,6 +95,7 @@ class OptionsMenu extends Page<OptionsMenuPageName>
createItem("PREFERENCES", function() codex.switchPage(Preferences));
createItem("CONTROLS", function() codex.switchPage(Controls));
createItem("INPUT OFFSETS", function() {
OptionsState.rememberedSelectedIndex = items.selectedIndex;
#if web
LoadingState.transitionToState(() -> new LatencyState());
#else
Expand Down Expand Up @@ -135,6 +138,8 @@ class OptionsMenu extends Page<OptionsMenuPageName>
});

createItem("EXIT", exit);

items.selectItem(OptionsState.rememberedSelectedIndex);
}

function createItem(name:String, callback:Void->Void, fireInstantly = false)
Expand Down