mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 01:32:55 +08:00
Move beatmap/ruleset change restrictions to OsuGame
Allows test cases to more freely exist
This commit is contained in:
parent
3254e16e9c
commit
09dd0cabd6
@ -359,6 +359,13 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.UpdateAfterChildren();
|
||||||
|
|
||||||
|
// we only want to apply these restrictions when we are inside a screen stack.
|
||||||
|
// the use case for not applying is in visual/unit tests.
|
||||||
|
bool applyRestrictions = currentScreen?.AllowBeatmapRulesetChange ?? false;
|
||||||
|
|
||||||
|
Ruleset.Disabled = applyRestrictions;
|
||||||
|
Beatmap.Disabled = applyRestrictions;
|
||||||
|
|
||||||
mainContent.Padding = new MarginPadding { Top = ToolbarOffset };
|
mainContent.Padding = new MarginPadding { Top = ToolbarOffset };
|
||||||
|
|
||||||
Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
|
Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
@ -69,19 +69,6 @@ namespace osu.Game.Screens
|
|||||||
sampleExit = audio.Sample.Get(@"UI/melodic-1");
|
sampleExit = audio.Sample.Get(@"UI/melodic-1");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
if (!IsCurrentScreen) return;
|
|
||||||
|
|
||||||
if (ParentScreen != null)
|
|
||||||
{
|
|
||||||
// we only want to apply these restrictions when we are inside a screen stack.
|
|
||||||
// the use case for not applying is in visual/unit tests.
|
|
||||||
Ruleset.Disabled = !AllowBeatmapRulesetChange;
|
|
||||||
Beatmap.Disabled = !AllowBeatmapRulesetChange;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnResuming(Screen last)
|
protected override void OnResuming(Screen last)
|
||||||
{
|
{
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
|
Loading…
Reference in New Issue
Block a user