Add a dummy beatmap provider for use in BeatmapInfoWedge

This commit is contained in:
Dean Herbert
2017-07-18 16:51:34 +09:00
parent 11ddded6fc
commit e47faf4e85
3 changed files with 51 additions and 13 deletions

View File

@ -45,6 +45,14 @@ namespace osu.Game.Screens.Select
};
}
protected override void LoadComplete()
{
base.LoadComplete();
State = Visibility.Visible;
AlwaysPresent = true;
}
protected override bool HideOnEscape => false;
protected override bool BlockPassThroughMouse => false;
@ -63,17 +71,8 @@ namespace osu.Game.Screens.Select
public void UpdateBeatmap(WorkingBeatmap beatmap)
{
if (beatmap?.BeatmapInfo == null)
{
State = Visibility.Hidden;
beatmapInfoContainer?.FadeOut(250);
beatmapInfoContainer?.Expire();
beatmapInfoContainer = null;
return;
}
State = Visibility.Visible;
AlwaysPresent = true;
if (beatmap == null)
beatmap = new DummyWorkingBeatmap();
var lastContainer = beatmapInfoContainer;
float newDepth = lastContainer?.Depth + 1 ?? 0;
@ -124,7 +123,8 @@ namespace osu.Game.Screens.Select
}));
//get statistics from the current ruleset.
labels.AddRange(beatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s)));
if (beatmapInfo.Ruleset != null)
labels.AddRange(beatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s)));
}
PixelSnapping = true;