From 3ea4eabdb6aba9f384ae376b062a452dcbea3c46 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Apr 2022 19:18:13 +0900 Subject: [PATCH] Ensure button text is updated on going backwards --- osu.Game/Overlays/FirstRunSetupOverlay.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/FirstRunSetupOverlay.cs b/osu.Game/Overlays/FirstRunSetupOverlay.cs index 0c800888ee..abde9636ba 100644 --- a/osu.Game/Overlays/FirstRunSetupOverlay.cs +++ b/osu.Game/Overlays/FirstRunSetupOverlay.cs @@ -246,6 +246,8 @@ namespace osu.Game.Overlays currentStepIndex--; BackButton.Enabled.Value = currentStepIndex != 0; + + updateButtonText(); } private void showNextStep() @@ -260,12 +262,8 @@ namespace osu.Game.Overlays if (currentStepIndex < steps.Length) { - var nextStep = steps[currentStepIndex.Value]; - stack.Push((Screen)Activator.CreateInstance(nextStep.ScreenType)); - - NextButton.Text = currentStepIndex + 1 < steps.Length - ? $"Next ({steps[currentStepIndex.Value + 1].Description})" - : "Finish"; + stack.Push((Screen)Activator.CreateInstance(steps[currentStepIndex.Value].ScreenType)); + updateButtonText(); } else { @@ -274,6 +272,15 @@ namespace osu.Game.Overlays } } + private void updateButtonText() + { + Debug.Assert(currentStepIndex != null); + + NextButton.Text = currentStepIndex + 1 < steps.Length + ? $"Next ({steps[currentStepIndex.Value + 1].Description})" + : "Finish"; + } + protected override void PopOut() { base.PopOut();