1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Merge pull request #17979 from peppy/first-run-show-get-started

Improve displayed text on first run setup back/next buttons
This commit is contained in:
Dan Balasescu 2022-04-26 17:04:03 +09:00 committed by GitHub
commit dc0f1a9419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 10 deletions

View File

@ -14,6 +14,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString Back => new TranslatableString(getKey(@"back"), @"Back");
/// <summary>
/// "Next"
/// </summary>
public static LocalisableString Next => new TranslatableString(getKey(@"next"), @"Next");
/// <summary>
/// "Finish"
/// </summary>

View File

@ -48,11 +48,6 @@ osu! is a very configurable game, and diving straight into the settings can some
/// </summary>
public static LocalisableString UIScaleDescription => new TranslatableString(getKey(@"ui_scale_description"), @"The size of the osu! user interface can be adjusted to your liking.");
/// <summary>
/// "Next ({0})"
/// </summary>
public static LocalisableString Next(LocalisableString nextStepDescription) => new TranslatableString(getKey(@"next"), @"Next ({0})", nextStepDescription);
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -133,7 +133,7 @@ namespace osu.Game.Overlays
{
BackButton = new DangerousTriangleButton
{
Width = 200,
Width = 300,
Text = CommonStrings.Back,
Action = showPreviousStep,
Enabled = { Value = false },
@ -304,11 +304,24 @@ namespace osu.Game.Overlays
BackButton.Enabled.Value = currentStepIndex > 0;
NextButton.Enabled.Value = currentStepIndex != null;
if (currentStepIndex != null)
if (currentStepIndex == null)
return;
bool isFirstStep = currentStepIndex == 0;
bool isLastStep = currentStepIndex == steps.Length - 1;
if (isFirstStep)
{
NextButton.Text = currentStepIndex + 1 < steps.Length
? FirstRunSetupOverlayStrings.Next(steps[currentStepIndex.Value + 1].Description)
: CommonStrings.Finish;
BackButton.Text = CommonStrings.Back;
NextButton.Text = FirstRunSetupOverlayStrings.GetStarted;
}
else
{
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);
}
}