Only show first run setup once per install

This commit is contained in:
Dean Herbert
2022-04-19 16:59:25 +09:00
parent 3378c91901
commit e2da1d76ca
2 changed files with 18 additions and 2 deletions

View File

@ -134,6 +134,8 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.Version, string.Empty); SetDefault(OsuSetting.Version, string.Empty);
SetDefault(OsuSetting.ShowFirstRunSetup, true);
SetDefault(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg); SetDefault(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg);
SetDefault(OsuSetting.ScreenshotCaptureMenuCursor, false); SetDefault(OsuSetting.ScreenshotCaptureMenuCursor, false);
@ -308,6 +310,7 @@ namespace osu.Game.Configuration
BeatmapListingCardSize, BeatmapListingCardSize,
ToolbarClockDisplayMode, ToolbarClockDisplayMode,
Version, Version,
ShowFirstRunSetup,
ShowConvertedBeatmaps, ShowConvertedBeatmaps,
Skin, Skin,
ScreenshotFormat, ScreenshotFormat,

View File

@ -6,6 +6,7 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -15,6 +16,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
@ -42,6 +44,9 @@ namespace osu.Game.Overlays
[Resolved] [Resolved]
private INotificationOverlay notificationOverlay { get; set; } = null!; private INotificationOverlay notificationOverlay { get; set; } = null!;
[Resolved]
private OsuConfigManager config { get; set; } = null!;
private ScreenStack? stack; private ScreenStack? stack;
public PurpleTriangleButton NextButton = null!; public PurpleTriangleButton NextButton = null!;
@ -50,6 +55,8 @@ namespace osu.Game.Overlays
[Cached] [Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
private readonly Bindable<bool> showFirstRunSetup = new Bindable<bool>();
private int? currentStepIndex; private int? currentStepIndex;
private const float scale_when_hidden = 0.9f; private const float scale_when_hidden = 0.9f;
@ -216,8 +223,13 @@ namespace osu.Game.Overlays
{ {
base.LoadComplete(); base.LoadComplete();
// if we are valid for display, only do so after reaching the main menu. config.BindWith(OsuSetting.ShowFirstRunSetup, showFirstRunSetup);
performer.PerformFromScreen(_ => { Show(); }, new[] { typeof(MainMenu) });
if (showFirstRunSetup.Value)
{
// if we are valid for display, only do so after reaching the main menu.
performer.PerformFromScreen(_ => { Show(); }, new[] { typeof(MainMenu) });
}
} }
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e) public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
@ -330,6 +342,7 @@ namespace osu.Game.Overlays
} }
else else
{ {
showFirstRunSetup.Value = false;
currentStepIndex = null; currentStepIndex = null;
Hide(); Hide();
} }