1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +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 ParallaxContainer buttonsContainer;
private SongTicker songTicker; private SongTicker songTicker;
private readonly BindableBool allowExitingAndroid = new BindableBool(true);
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics) private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
{ {
holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay); holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay);
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed); loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
host.AllowExitingAndroid.AddSource(allowExitingAndroid);
if (host.CanExit) if (host.CanExit)
{ {
AddInternal(exitConfirmOverlay = new ExitConfirmOverlay AddInternal(exitConfirmOverlay = new ExitConfirmOverlay
@ -134,6 +138,8 @@ namespace osu.Game.Screens.Menu
ApplyToBackground(b => b.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine)); ApplyToBackground(b => b.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine));
break; break;
} }
allowExitingAndroid.Value = state == ButtonSystemState.Initial;
}; };
buttons.OnSettings = () => settings?.ToggleVisibility(); buttons.OnSettings = () => settings?.ToggleVisibility();
@ -297,5 +303,11 @@ namespace osu.Game.Screens.Menu
Schedule(loadSoloSongSelect); Schedule(loadSoloSongSelect);
} }
protected override void Dispose(bool isDisposing)
{
host.AllowExitingAndroid.RemoveSource(allowExitingAndroid);
base.Dispose(isDisposing);
}
} }
} }