Disable beatmap changes in specified screens

This commit is contained in:
Dean Herbert
2017-07-11 18:39:10 +09:00
parent 773ef26ce3
commit 9bbcc0526d
4 changed files with 10 additions and 5 deletions

View File

@ -29,7 +29,11 @@ namespace osu.Game.Screens
internal virtual bool HasLocalCursorDisplayed => false;
internal virtual bool AllowRulesetChange => true;
/// <summary>
/// Whether the beatmap or ruleset should be allowed to be changed by the user or game.
/// Used to mark exclusive areas where this is strongly prohibited, like gameplay.
/// </summary>
internal virtual bool AllowBeatmapRulesetChange => true;
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
@ -85,7 +89,8 @@ namespace osu.Game.Screens
{
if (!IsCurrentScreen) return;
ruleset.Disabled = !AllowRulesetChange;
ruleset.Disabled = !AllowBeatmapRulesetChange;
beatmap.Disabled = !AllowBeatmapRulesetChange;
}
protected override void OnResuming(Screen last)