From c6d017b503cd5ff8ab6d75f52995923ef5460826 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Dec 2018 19:23:58 +0900 Subject: [PATCH] And some more --- osu.Desktop/OsuGameDesktop.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 93fd3935c6..bd9ba3501f 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -15,12 +15,16 @@ using Microsoft.Win32; using osu.Desktop.Updater; using osu.Framework; using osu.Framework.Platform.Windows; +using osu.Framework.Screens; +using osu.Game.Screens; +using osu.Game.Screens.Menu; namespace osu.Desktop { internal class OsuGameDesktop : OsuGame { private readonly bool noVersionOverlay; + private VersionManager versionManager; public OsuGameDesktop(string[] args = null) : base(args) @@ -46,7 +50,7 @@ namespace osu.Desktop if (!noVersionOverlay) { - LoadComponentAsync(new VersionManager { Depth = int.MinValue }, v => + LoadComponentAsync(versionManager = new VersionManager { Depth = int.MinValue }, v => { Add(v); v.State = Visibility.Visible; @@ -59,6 +63,21 @@ namespace osu.Desktop } } + protected override void ScreenChanged(OsuScreen current, Screen newScreen) + { + base.ScreenChanged(current, newScreen); + switch (newScreen) + { + case Intro _: + case MainMenu _: + versionManager.State = Visibility.Visible; + break; + default: + versionManager.State = Visibility.Hidden; + break; + } + } + public override void SetHost(GameHost host) { base.SetHost(host);