1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Allow exiting/minimizing on Android when on the initial cookie screen

This commit is contained in:
Susko3 2022-02-19 18:14:56 +01:00
parent 65ffcefdf9
commit 7ef710de22

View File

@ -70,12 +70,16 @@ namespace osu.Game.Screens.Menu
private ParallaxContainer buttonsContainer;
private SongTicker songTicker;
private readonly BindableBool allowExitingAndroid = new BindableBool(true);
[BackgroundDependencyLoader(true)]
private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
{
holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay);
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
host.AllowExitingAndroid.AddSource(allowExitingAndroid);
if (host.CanExit)
{
AddInternal(exitConfirmOverlay = new ExitConfirmOverlay
@ -134,6 +138,8 @@ namespace osu.Game.Screens.Menu
ApplyToBackground(b => b.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine));
break;
}
allowExitingAndroid.Value = state == ButtonSystemState.Initial;
};
buttons.OnSettings = () => settings?.ToggleVisibility();
@ -297,5 +303,11 @@ namespace osu.Game.Screens.Menu
Schedule(loadSoloSongSelect);
}
protected override void Dispose(bool isDisposing)
{
host.AllowExitingAndroid.RemoveSource(allowExitingAndroid);
base.Dispose(isDisposing);
}
}
}