1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 08:22:56 +08:00

And some more

This commit is contained in:
Dean Herbert 2018-12-27 19:23:58 +09:00
parent bdadd1bba2
commit c6d017b503

View File

@ -15,12 +15,16 @@ using Microsoft.Win32;
using osu.Desktop.Updater; using osu.Desktop.Updater;
using osu.Framework; using osu.Framework;
using osu.Framework.Platform.Windows; using osu.Framework.Platform.Windows;
using osu.Framework.Screens;
using osu.Game.Screens;
using osu.Game.Screens.Menu;
namespace osu.Desktop namespace osu.Desktop
{ {
internal class OsuGameDesktop : OsuGame internal class OsuGameDesktop : OsuGame
{ {
private readonly bool noVersionOverlay; private readonly bool noVersionOverlay;
private VersionManager versionManager;
public OsuGameDesktop(string[] args = null) public OsuGameDesktop(string[] args = null)
: base(args) : base(args)
@ -46,7 +50,7 @@ namespace osu.Desktop
if (!noVersionOverlay) if (!noVersionOverlay)
{ {
LoadComponentAsync(new VersionManager { Depth = int.MinValue }, v => LoadComponentAsync(versionManager = new VersionManager { Depth = int.MinValue }, v =>
{ {
Add(v); Add(v);
v.State = Visibility.Visible; 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) public override void SetHost(GameHost host)
{ {
base.SetHost(host); base.SetHost(host);