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

Add sample usage to the session statics

This commit is contained in:
iiSaLMaN 2019-09-24 05:45:47 +03:00
parent e3e245ab20
commit 267e12ce3c
2 changed files with 8 additions and 3 deletions

View File

@ -17,5 +17,6 @@ namespace osu.Game.Configuration
public enum Statics
{
LoginOverlayDisplayed,
}
}

View File

@ -52,6 +52,9 @@ namespace osu.Game.Screens.Menu
[Resolved(canBeNull: true)]
private LoginOverlay login { get; set; }
[Resolved]
private SessionStatics statics { get; set; }
[Resolved]
private IAPIProvider api { get; set; }
@ -170,7 +173,6 @@ namespace osu.Game.Screens.Menu
Beatmap.ValueChanged += beatmap_ValueChanged;
}
private bool loginDisplayed;
private bool exitConfirmed;
protected override void LogoArriving(OsuLogo logo, bool resuming)
@ -198,10 +200,12 @@ namespace osu.Game.Screens.Menu
bool displayLogin()
{
if (!loginDisplayed)
var loginDisplayed = statics.GetBindable<bool>(Statics.LoginOverlayDisplayed);
if (!loginDisplayed.Value)
{
Scheduler.AddDelayed(() => login?.Show(), 500);
loginDisplayed = true;
loginDisplayed.Value = true;
}
return true;