Ensure button text is updated on going backwards

This commit is contained in:
Dean Herbert
2022-04-18 19:18:13 +09:00
parent fb7dc89503
commit 3ea4eabdb6

View File

@ -246,6 +246,8 @@ namespace osu.Game.Overlays
currentStepIndex--; currentStepIndex--;
BackButton.Enabled.Value = currentStepIndex != 0; BackButton.Enabled.Value = currentStepIndex != 0;
updateButtonText();
} }
private void showNextStep() private void showNextStep()
@ -260,12 +262,8 @@ namespace osu.Game.Overlays
if (currentStepIndex < steps.Length) if (currentStepIndex < steps.Length)
{ {
var nextStep = steps[currentStepIndex.Value]; stack.Push((Screen)Activator.CreateInstance(steps[currentStepIndex.Value].ScreenType));
stack.Push((Screen)Activator.CreateInstance(nextStep.ScreenType)); updateButtonText();
NextButton.Text = currentStepIndex + 1 < steps.Length
? $"Next ({steps[currentStepIndex.Value + 1].Description})"
: "Finish";
} }
else 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() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();