mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 01:02:54 +08: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,
|
Origin = Anchor.BottomLeft,
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
if ((ScreenStack.CurrentScreen as IOsuScreen)?.AllowBackButton == true)
|
var currentScreen = ScreenStack.CurrentScreen as IOsuScreen;
|
||||||
|
|
||||||
|
if (currentScreen?.AllowBackButton == true && !currentScreen.OnBackButton())
|
||||||
ScreenStack.Exit();
|
ScreenStack.Exit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -56,5 +56,7 @@ namespace osu.Game.Screens
|
|||||||
/// Whether mod rate adjustments are allowed to be applied.
|
/// Whether mod rate adjustments are allowed to be applied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool AllowRateAdjustments { get; }
|
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.
|
/// Note that the instance created may not be the used instance if it matches the BackgroundMode equality clause.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual BackgroundScreen CreateBackground() => null;
|
protected virtual BackgroundScreen CreateBackground() => null;
|
||||||
|
|
||||||
|
public virtual bool OnBackButton() => false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user