From 77c1ed2d2d4738b42b666261b8f0c4863fcd6a0f Mon Sep 17 00:00:00 2001 From: Kirefel Date: Wed, 22 Mar 2023 11:01:00 +1100 Subject: [PATCH] Fix wizard back button bug --- Randomiser/GenerateRandomiserSeedWizardController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Randomiser/GenerateRandomiserSeedWizardController.cs b/Randomiser/GenerateRandomiserSeedWizardController.cs index 661cc3a..31bc014 100644 --- a/Randomiser/GenerateRandomiserSeedWizardController.cs +++ b/Randomiser/GenerateRandomiserSeedWizardController.cs @@ -80,6 +80,9 @@ void OnDestroy() MessageBox[] messageBoxes; BasicMessageProvider[] tooltips; + /// When pressing Back how far back should we go. Usually 1 but quickstart skips some steps. + int backStepSize; + private void SetOptionCount(int count) { selectionManager.MenuItems.Clear(); @@ -244,6 +247,7 @@ public void OnSelectMenuItem(int index) seedGenOptions.LogicPreset = LogicPath.Standard; seedGenOptions.Seed = seed.ToString(); + backStepSize = WizardState.Difficulty - WizardState.Start; GoToState(WizardState.Difficulty); return; } @@ -278,6 +282,7 @@ public void OnSelectMenuItem(int index) break; } + backStepSize = 1; options[index].HighlightAnimator.AnimatorDriver.GoToStart(); GoToState(state + 1); } @@ -290,7 +295,7 @@ public void GoBackwards() return; } - GoToState(state - 1); + GoToState(state - backStepSize); } } }