mirror of
https://github.com/ppy/osu
synced 2025-02-02 03:11:58 +00:00
Update null background handling
This commit is contained in:
parent
66d104394f
commit
0a81fdbd10
@ -24,14 +24,17 @@ namespace osu.Game.Screens.Backgrounds
|
||||
}
|
||||
set
|
||||
{
|
||||
if (beatmap == value)
|
||||
if (beatmap == value && beatmap != null)
|
||||
return;
|
||||
|
||||
beatmap = value;
|
||||
|
||||
Schedule(() =>
|
||||
{
|
||||
Background newBackground = new BeatmapBackground(beatmap);
|
||||
Background newBackground;
|
||||
if (beatmap == null)
|
||||
newBackground = new Background(@"Backgrounds/bg1");
|
||||
else
|
||||
newBackground = new BeatmapBackground(beatmap);
|
||||
|
||||
newBackground.Preload(Game, delegate
|
||||
{
|
||||
@ -55,8 +58,6 @@ namespace osu.Game.Screens.Backgrounds
|
||||
public BackgroundModeBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
Beatmap = beatmap;
|
||||
if (beatmap == null)
|
||||
Add(background = new Background(@"Backgrounds/bg1"));
|
||||
}
|
||||
|
||||
public void BlurTo(Vector2 sigma, double duration)
|
||||
|
@ -298,18 +298,15 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void changeBackground(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (beatmap == null)
|
||||
return;
|
||||
|
||||
var backgroundModeBeatmap = Background as BackgroundModeBeatmap;
|
||||
if (backgroundModeBeatmap != null)
|
||||
{
|
||||
backgroundModeBeatmap.Beatmap = beatmap;
|
||||
// TODO: Remove this once we have non-nullable Beatmap
|
||||
(Background as BackgroundModeBeatmap)?.BlurTo(BACKGROUND_BLUR, 1000);
|
||||
backgroundModeBeatmap.BlurTo(BACKGROUND_BLUR, 1000);
|
||||
}
|
||||
|
||||
beatmapInfoWedge.UpdateBeatmap(beatmap);
|
||||
if (beatmap != null)
|
||||
beatmapInfoWedge.UpdateBeatmap(beatmap);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user