mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:57:52 +08:00
Use bindable setting instead
This commit is contained in:
parent
cde7f49db1
commit
8844d567cb
@ -52,9 +52,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private LoginOverlay login { get; set; }
|
private LoginOverlay login { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private SessionStatics statics { get; set; }
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider api { get; set; }
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
@ -66,13 +63,15 @@ namespace osu.Game.Screens.Menu
|
|||||||
protected override BackgroundScreen CreateBackground() => background;
|
protected override BackgroundScreen CreateBackground() => background;
|
||||||
|
|
||||||
private Bindable<int> holdDelay;
|
private Bindable<int> holdDelay;
|
||||||
|
private Bindable<bool> loginDisplayed;
|
||||||
|
|
||||||
private ExitConfirmOverlay exitConfirmOverlay;
|
private ExitConfirmOverlay exitConfirmOverlay;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(DirectOverlay direct, SettingsOverlay settings, OsuConfigManager config)
|
private void load(DirectOverlay direct, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
|
||||||
{
|
{
|
||||||
holdDelay = config.GetBindable<int>(OsuSetting.UIHoldActivationDelay);
|
holdDelay = config.GetBindable<int>(OsuSetting.UIHoldActivationDelay);
|
||||||
|
loginDisplayed = statics.GetBindable<bool>(Statics.LoginOverlayDisplayed);
|
||||||
|
|
||||||
if (host.CanExit)
|
if (host.CanExit)
|
||||||
{
|
{
|
||||||
@ -200,10 +199,10 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
bool displayLogin()
|
bool displayLogin()
|
||||||
{
|
{
|
||||||
if (!statics.Get<bool>(Statics.LoginOverlayDisplayed))
|
if (!loginDisplayed.Value)
|
||||||
{
|
{
|
||||||
Scheduler.AddDelayed(() => login?.Show(), 500);
|
Scheduler.AddDelayed(() => login?.Show(), 500);
|
||||||
statics.Set(Statics.LoginOverlayDisplayed, true);
|
loginDisplayed.Value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user