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 41eabbbfce4..b132dc39f59 100644 --- a/source/funkin/ui/options/OptionsState.hx +++ b/source/funkin/ui/options/OptionsState.hx @@ -27,6 +27,8 @@ class OptionsState extends MusicBeatState { var optionsCodex:Codex; + public static var rememberedSelectedIndex:Int = 0; + override function create():Void { persistentUpdate = true; @@ -103,6 +105,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 @@ -145,7 +148,7 @@ class OptionsMenu extends Page }); createItem("EXIT", exit); - + // Create an object for the camera to track. camFocusPoint = new FlxObject(0, 0, 140, 70); add(camFocusPoint); @@ -159,6 +162,8 @@ class OptionsMenu extends Page items.onChange.add(onMenuChange); onMenuChange(items.members[0]); + + items.selectItem(OptionsState.rememberedSelectedIndex); } function onMenuChange(selected:TextMenuList.TextMenuItem)