From 3289d93f228bfe1f0e136d7fb3a4aa21917759be Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jul 2017 17:59:43 +0900 Subject: [PATCH] Give the dummy beatmap a background --- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 7 +++++-- osu.Game/Screens/OsuScreen.cs | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index 267198c94c..06a06be538 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -11,7 +11,9 @@ namespace osu.Game.Beatmaps { internal class DummyWorkingBeatmap : WorkingBeatmap { - public DummyWorkingBeatmap() + private readonly OsuGame game; + + public DummyWorkingBeatmap(OsuGame game) : base(new BeatmapInfo { Metadata = new BeatmapMetadata @@ -24,6 +26,7 @@ namespace osu.Game.Beatmaps Difficulty = new BeatmapDifficulty(), }) { + this.game = game; } protected override Beatmap GetBeatmap() => new Beatmap @@ -31,7 +34,7 @@ namespace osu.Game.Beatmaps HitObjects = new List(), }; - protected override Texture GetBackground() => null; + protected override Texture GetBackground() => game.Textures.Get(@"Backgrounds/bg4"); protected override Track GetTrack() => new TrackVirtual(); } diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index cf03fcd845..42e9baf318 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -41,6 +41,8 @@ namespace osu.Game.Screens private SampleChannel sampleExit; + private DummyWorkingBeatmap dummyBeatmap; + public WorkingBeatmap Beatmap { get @@ -49,13 +51,15 @@ namespace osu.Game.Screens } set { - beatmap.Value = value ?? new DummyWorkingBeatmap(); + beatmap.Value = value ?? dummyBeatmap; } } [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGameBase game, OsuGame osuGame, AudioManager audio) { + dummyBeatmap = new DummyWorkingBeatmap(osuGame); + if (game != null) { //if we were given a beatmap at ctor time, we want to pass this on to the game-wide beatmap.