mirror of https://github.com/ppy/osu
Add sample usage to the session statics
This commit is contained in:
parent
e3e245ab20
commit
267e12ce3c
|
@ -17,5 +17,6 @@ protected override void PerformLoad()
|
|||
|
||||
public enum Statics
|
||||
{
|
||||
LoginOverlayDisplayed,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue