Skip to content

Commit

Permalink
Fix wizard back button bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirefel committed Mar 22, 2023
1 parent f51ba75 commit 77c1ed2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Randomiser/GenerateRandomiserSeedWizardController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ void OnDestroy()
MessageBox[] messageBoxes;
BasicMessageProvider[] tooltips;

/// <summary>When pressing Back how far back should we go. Usually 1 but quickstart skips some steps.</summary>
int backStepSize;

private void SetOptionCount(int count)
{
selectionManager.MenuItems.Clear();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -278,6 +282,7 @@ public void OnSelectMenuItem(int index)
break;
}

backStepSize = 1;
options[index].HighlightAnimator.AnimatorDriver.GoToStart();
GoToState(state + 1);
}
Expand All @@ -290,7 +295,7 @@ public void GoBackwards()
return;
}

GoToState(state - 1);
GoToState(state - backStepSize);
}
}
}

0 comments on commit 77c1ed2

Please sign in to comment.