From fb7dc895036aae174fa77f10189b253eebb6f8a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Apr 2022 19:08:34 +0900 Subject: [PATCH] Ensure wizard returns to initial screen after completion --- .../UserInterface/TestSceneFirstRunSetupOverlay.cs | 4 ++++ osu.Game/Overlays/FirstRunSetupOverlay.cs | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunSetupOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunSetupOverlay.cs index d892301a81..d22dd260eb 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunSetupOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunSetupOverlay.cs @@ -60,6 +60,10 @@ namespace osu.Game.Tests.Visual.UserInterface return overlay.State.Value == Visibility.Hidden; }); + + AddStep("display again on demand", () => overlay.Show()); + + AddUntilStep("back at start", () => overlay.CurrentScreen is ScreenWelcome); } [Test] diff --git a/osu.Game/Overlays/FirstRunSetupOverlay.cs b/osu.Game/Overlays/FirstRunSetupOverlay.cs index d7fd7ed104..0c800888ee 100644 --- a/osu.Game/Overlays/FirstRunSetupOverlay.cs +++ b/osu.Game/Overlays/FirstRunSetupOverlay.cs @@ -262,15 +262,16 @@ namespace osu.Game.Overlays { 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"; } else { Hide(); + currentStepIndex = null; } - - NextButton.Text = currentStepIndex + 1 < steps.Length - ? $"Next ({steps[currentStepIndex.Value + 1].Description})" - : "Finish"; } protected override void PopOut()