diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index ad79865ad9..029a7f8b9e 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -51,6 +51,7 @@ namespace osu.Game.Tests.Visual.UserInterface AddStep("clear contents", Clear); AddStep("reset ruleset", () => Ruleset.Value = rulesetStore.GetRuleset(0)); AddStep("reset mods", () => SelectedMods.SetDefault()); + AddStep("set beatmap", () => Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo)); AddStep("set up presets", () => { Realm.Write(r => @@ -92,6 +93,7 @@ namespace osu.Game.Tests.Visual.UserInterface { RelativeSizeAxes = Axes.Both, State = { Value = Visibility.Visible }, + Beatmap = Beatmap.Value, SelectedMods = { BindTarget = SelectedMods } }); waitForColumnLoad(); diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index f2f2dc970c..1c5fc5abde 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -133,9 +133,9 @@ namespace osu.Game.Overlays.Mods private Sample? columnAppearSample; - private WorkingBeatmap beatmap = null!; + private WorkingBeatmap? beatmap; - public WorkingBeatmap Beatmap + public WorkingBeatmap? Beatmap { get => beatmap; set @@ -143,7 +143,8 @@ namespace osu.Game.Overlays.Mods if (beatmap == value) return; beatmap = value; - modEffectPreviewPanel.BeatmapInfo.Value = beatmap.BeatmapInfo; + if (IsLoaded) + modEffectPreviewPanel.BeatmapInfo.Value = beatmap?.BeatmapInfo; } } @@ -246,7 +247,8 @@ namespace osu.Game.Overlays.Mods { Vertical = PADDING, Horizontal = 70 - } + }, + BeatmapInfo = { Value = beatmap?.BeatmapInfo } }, footerButtonFlow = new FillFlowContainer {