mirror of
https://github.com/ppy/osu
synced 2025-01-12 09:09:44 +00:00
Add OnBackButton bool to OsuScreen
This commit is contained in:
parent
e0d9e70404
commit
1a2f5cb477
@ -573,7 +573,9 @@ namespace osu.Game
|
||||
Origin = Anchor.BottomLeft,
|
||||
Action = () =>
|
||||
{
|
||||
if ((ScreenStack.CurrentScreen as IOsuScreen)?.AllowBackButton == true)
|
||||
var currentScreen = ScreenStack.CurrentScreen as IOsuScreen;
|
||||
|
||||
if (currentScreen?.AllowBackButton == true && !currentScreen.OnBackButton())
|
||||
ScreenStack.Exit();
|
||||
}
|
||||
},
|
||||
|
@ -56,5 +56,7 @@ namespace osu.Game.Screens
|
||||
/// Whether mod rate adjustments are allowed to be applied.
|
||||
/// </summary>
|
||||
bool AllowRateAdjustments { get; }
|
||||
|
||||
bool OnBackButton();
|
||||
}
|
||||
}
|
||||
|
@ -258,5 +258,7 @@ namespace osu.Game.Screens
|
||||
/// Note that the instance created may not be the used instance if it matches the BackgroundMode equality clause.
|
||||
/// </summary>
|
||||
protected virtual BackgroundScreen CreateBackground() => null;
|
||||
|
||||
public virtual bool OnBackButton() => false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user