diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index b234207848..cd3fb7eb61 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -10,14 +10,11 @@ using System.Runtime.Versioning; using System.Threading.Tasks; using Microsoft.Win32; using osu.Desktop.Security; -using osu.Desktop.Overlays; using osu.Framework.Platform; using osu.Game; using osu.Desktop.Updater; using osu.Framework; using osu.Framework.Logging; -using osu.Framework.Screens; -using osu.Game.Screens.Menu; using osu.Game.Updater; using osu.Desktop.Windows; using osu.Framework.Threading; @@ -27,13 +24,9 @@ namespace osu.Desktop { internal class OsuGameDesktop : OsuGame { - private readonly bool noVersionOverlay; - private VersionManager versionManager; - public OsuGameDesktop(string[] args = null) : base(args) { - noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false; } public override StableStorage GetStorageForStableInstall() @@ -114,9 +107,6 @@ namespace osu.Desktop { base.LoadComplete(); - if (!noVersionOverlay) - LoadComponentAsync(versionManager = new VersionManager { Depth = int.MinValue }, ScreenContainer.Add); - LoadComponentAsync(new DiscordRichPresence(), Add); if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows) @@ -125,23 +115,6 @@ namespace osu.Desktop LoadComponentAsync(new ElevatedPrivilegesChecker(), Add); } - protected override void ScreenChanged(IScreen lastScreen, IScreen newScreen) - { - base.ScreenChanged(lastScreen, newScreen); - - switch (newScreen) - { - case IntroScreen _: - case MainMenu _: - versionManager?.Show(); - break; - - default: - versionManager?.Hide(); - break; - } - } - public override void SetHost(GameHost host) { base.SetHost(host); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 21d84a365b..6730f2cf65 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -154,6 +154,8 @@ namespace osu.Game private MainMenu menuScreen; + private VersionManager versionManager; + [CanBeNull] private IntroScreen introScreen; @@ -743,6 +745,9 @@ namespace osu.Game ScreenStack.ScreenPushed += screenPushed; ScreenStack.ScreenExited += screenExited; + if (!args?.Any(a => a == @"--no-version-overlay") ?? true) + loadComponentSingleFile(versionManager = new VersionManager { Depth = int.MinValue }, ScreenContainer.Add); + loadComponentSingleFile(osuLogo, logo => { logoContainer.Add(logo); @@ -1126,10 +1131,16 @@ namespace osu.Game { case IntroScreen intro: introScreen = intro; + versionManager?.Show(); break; case MainMenu menu: menuScreen = menu; + versionManager?.Show(); + break; + + default: + versionManager?.Hide(); break; } diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Game/Overlays/VersionManager.cs similarity index 98% rename from osu.Desktop/Overlays/VersionManager.cs rename to osu.Game/Overlays/VersionManager.cs index e4a3451651..fe6613fba2 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Game/Overlays/VersionManager.cs @@ -7,13 +7,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Game; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osuTK; using osuTK.Graphics; -namespace osu.Desktop.Overlays +namespace osu.Game.Overlays { public class VersionManager : VisibilityContainer {