From c2e5788ed1375d7391cfb82a3c0c5fd70c6d0f76 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 24 Jul 2017 21:47:31 +0800 Subject: [PATCH] Make OsuScreen.Ruleset protected. --- osu.Game/Screens/OsuScreen.cs | 6 +++--- osu.Game/Screens/Select/SongSelect.cs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index d916614abd..0ab051f681 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -47,7 +47,7 @@ namespace osu.Game.Screens } } - private readonly Bindable ruleset = new Bindable(); + protected readonly Bindable Ruleset = new Bindable(); private SampleChannel sampleExit; @@ -64,7 +64,7 @@ namespace osu.Game.Screens } if (osuGame != null) - ruleset.BindTo(osuGame.Ruleset); + Ruleset.BindTo(osuGame.Ruleset); sampleExit = audio.Sample.Get(@"UI/melodic-1"); } @@ -77,7 +77,7 @@ namespace osu.Game.Screens { // 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; + Ruleset.Disabled = !AllowBeatmapRulesetChange; Beatmap.Disabled = !AllowBeatmapRulesetChange; } } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 286045b5d3..867b1e60c0 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -27,7 +27,6 @@ namespace osu.Game.Screens.Select { public abstract class SongSelect : OsuScreen { - protected readonly Bindable Ruleset = new Bindable(); private BeatmapDatabase database; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(); @@ -251,7 +250,7 @@ namespace osu.Game.Screens.Select } else { - ruleset.Value = beatmap.Ruleset; + Ruleset.Value = beatmap.Ruleset; if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID) sampleChangeDifficulty.Play();