Show last step on back button as well

This commit is contained in:
Dean Herbert 2022-04-26 16:03:15 +09:00
parent 37ae39f5fe
commit a078440012

View File

@ -133,7 +133,7 @@ namespace osu.Game.Overlays
{ {
BackButton = new DangerousTriangleButton BackButton = new DangerousTriangleButton
{ {
Width = 200, Width = 300,
Text = CommonStrings.Back, Text = CommonStrings.Back,
Action = showPreviousStep, Action = showPreviousStep,
Enabled = { Value = false }, Enabled = { Value = false },
@ -307,12 +307,22 @@ namespace osu.Game.Overlays
if (currentStepIndex == null) if (currentStepIndex == null)
return; return;
if (currentStepIndex == 0) bool isFirstStep = currentStepIndex == 0;
bool isLastStep = currentStepIndex == steps.Length - 1;
if (isFirstStep)
{
BackButton.Text = CommonStrings.Back;
NextButton.Text = FirstRunSetupOverlayStrings.GetStarted; NextButton.Text = FirstRunSetupOverlayStrings.GetStarted;
else if (currentStepIndex < steps.Length - 1) }
NextButton.Text = new TranslatableString(@"_", @"{0} ({1})", CommonStrings.Next, steps[currentStepIndex.Value + 1].Description);
else else
NextButton.Text = CommonStrings.Finish; {
BackButton.Text = new TranslatableString(@"_", @"{0} ({1})", CommonStrings.Back, steps[currentStepIndex.Value - 1].Description);
NextButton.Text = isLastStep
? CommonStrings.Finish
: new TranslatableString(@"_", @"{0} ({1})", CommonStrings.Next, steps[currentStepIndex.Value + 1].Description);
}
} }
private class FirstRunStep private class FirstRunStep