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 @@ protected override void PerformLoad()
public enum Statics
{
LoginOverlayDisplayed,
}
}

View File

@ -52,6 +52,9 @@ public class MainMenu : OsuScreen
[Resolved(canBeNull: true)]
private LoginOverlay login { get; set; }
[Resolved]
private SessionStatics statics { get; set; }
[Resolved]
private IAPIProvider api { get; set; }
@ -170,7 +173,6 @@ public override void OnEntering(IScreen last)
Beatmap.ValueChanged += beatmap_ValueChanged;
}
private bool loginDisplayed;
private bool exitConfirmed;
protected override void LogoArriving(OsuLogo logo, bool resuming)
@ -198,10 +200,12 @@ protected override void LogoArriving(OsuLogo logo, bool resuming)
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;