1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

Fix data flow being sometimes incorrect

This commit is contained in:
Bartłomiej Dach 2023-09-11 09:52:43 +02:00
parent 552230af9d
commit 53c30dca64
No known key found for this signature in database
2 changed files with 8 additions and 4 deletions

View File

@ -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();

View File

@ -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<ShearedButton>
{