mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:03:22 +08:00
Give the dummy beatmap a background
This commit is contained in:
parent
007b343854
commit
3289d93f22
@ -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<HitObject>(),
|
||||
};
|
||||
|
||||
protected override Texture GetBackground() => null;
|
||||
protected override Texture GetBackground() => game.Textures.Get(@"Backgrounds/bg4");
|
||||
|
||||
protected override Track GetTrack() => new TrackVirtual();
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user