diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 56d241d2c8..bfe1778f39 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -68,7 +68,7 @@ namespace osu.Game.Screens /// public virtual bool AllowBeatmapRulesetChange => true; - protected readonly IBindable Beatmap = new Bindable(); + protected readonly Bindable Beatmap = new Bindable(); protected virtual float BackgroundParallaxAmount => 1; @@ -78,8 +78,8 @@ namespace osu.Game.Screens private SampleChannel sampleExit; - [BackgroundDependencyLoader(permitNulls: true)] - private void load(IBindableBeatmap beatmap, OsuGame osuGame, AudioManager audio) + [BackgroundDependencyLoader(true)] + private void load(BindableBeatmap beatmap, OsuGame osuGame, AudioManager audio) { if (beatmap != null) Beatmap.BindTo(beatmap); diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index b73beb80a0..8ce40fcfa0 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -30,8 +30,6 @@ namespace osu.Game.Screens.Select protected readonly BeatmapDetailArea BeatmapDetails; private bool removeAutoModOnResume; - private BindableBeatmap beatmap; - public PlaySongSelect() { FooterPanels.Add(modSelect = new ModSelectOverlay @@ -55,10 +53,8 @@ namespace osu.Game.Screens.Select public readonly Bindable> SelectedMods = new Bindable>(new List()); [BackgroundDependencyLoader(true)] - private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, OsuGame osu, BindableBeatmap beatmap) + private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, OsuGame osu) { - this.beatmap = beatmap.GetBoundCopy(); - if (osu != null) SelectedMods.BindTo(osu.SelectedMods); modSelect.SelectedMods.BindTo(SelectedMods); @@ -160,7 +156,7 @@ namespace osu.Game.Screens.Select } Beatmap.Value.Track.Looping = false; - beatmap.Disabled = true; + Beatmap.Disabled = true; sampleConfirm?.Play(); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 52880418b8..b04ffecf48 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -62,8 +62,6 @@ namespace osu.Game.Screens.Select private SampleChannel sampleChangeDifficulty; private SampleChannel sampleChangeBeatmap; - private BindableBeatmap beatmap; - private DependencyContainer dependencies; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); @@ -178,11 +176,9 @@ namespace osu.Game.Screens.Select } } - [BackgroundDependencyLoader(permitNulls: true)] - private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, BindableBeatmap beatmap) + [BackgroundDependencyLoader(true)] + private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours) { - this.beatmap = beatmap.GetBoundCopy(); - dependencies.CacheAs(this); if (Footer != null) @@ -219,7 +215,7 @@ namespace osu.Game.Screens.Select public void Edit(BeatmapInfo beatmap) { - this.beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); + Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); Push(new Editor()); } @@ -285,7 +281,7 @@ namespace osu.Game.Screens.Select { bool preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID; - this.beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); + Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); ensurePlayingSelected(preview); }