diff --git a/source/funkin/ui/debug/latency/LatencyState.hx b/source/funkin/ui/debug/latency/LatencyState.hx index 132439eb90f..27fcd5689a2 100644 --- a/source/funkin/ui/debug/latency/LatencyState.hx +++ b/source/funkin/ui/debug/latency/LatencyState.hx @@ -314,7 +314,7 @@ class LatencyState extends MusicBeatSubState { // close(); cleanup(); - FlxG.switchState(() -> new MainMenuState()); + FlxG.switchState(() -> new funkin.ui.options.OptionsState()); } super.update(elapsed); diff --git a/source/funkin/ui/options/OptionsState.hx b/source/funkin/ui/options/OptionsState.hx index 4337495ed55..cd2791ed687 100644 --- a/source/funkin/ui/options/OptionsState.hx +++ b/source/funkin/ui/options/OptionsState.hx @@ -25,6 +25,8 @@ class OptionsState extends MusicBeatState { var optionsCodex:Codex; + public static var rememberedSelectedIndex:Int = 0; + override function create():Void { persistentUpdate = true; @@ -93,6 +95,7 @@ class OptionsMenu extends Page 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 @@ -135,6 +138,8 @@ class OptionsMenu extends Page }); createItem("EXIT", exit); + + items.selectItem(OptionsState.rememberedSelectedIndex); } function createItem(name:String, callback:Void->Void, fireInstantly = false)