mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add failing test
Add test case demonstrating the lack of update of the metadata display's mods upon setting the Mods property in PlayerLoader.
This commit is contained in:
@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private LogoTrackingContainer content;
|
||||
|
||||
private BeatmapMetadataDisplay info;
|
||||
protected BeatmapMetadataDisplay MetadataInfo;
|
||||
|
||||
private bool hideOverlays;
|
||||
public override bool HideOverlaysOnEnter => hideOverlays;
|
||||
@ -96,7 +96,7 @@ namespace osu.Game.Screens.Play
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}).WithChildren(new Drawable[]
|
||||
{
|
||||
info = new BeatmapMetadataDisplay(Beatmap.Value, Mods.Value, content.LogoFacade)
|
||||
MetadataInfo = new BeatmapMetadataDisplay(Beatmap.Value, Mods.Value, content.LogoFacade)
|
||||
{
|
||||
Alpha = 0,
|
||||
Anchor = Anchor.Centre,
|
||||
@ -138,7 +138,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
contentIn();
|
||||
|
||||
info.Delay(750).FadeIn(500);
|
||||
MetadataInfo.Delay(750).FadeIn(500);
|
||||
this.Delay(1800).Schedule(pushWhenLoaded);
|
||||
|
||||
if (!muteWarningShownOnce.Value)
|
||||
@ -158,7 +158,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
contentIn();
|
||||
|
||||
info.Loading = true;
|
||||
MetadataInfo.Loading = true;
|
||||
|
||||
//we will only be resumed if the player has requested a re-run (see ValidForResume setting above)
|
||||
loadNewPlayer();
|
||||
@ -174,7 +174,7 @@ namespace osu.Game.Screens.Play
|
||||
player.RestartCount = restartCount;
|
||||
player.RestartRequested = restartRequested;
|
||||
|
||||
LoadTask = LoadComponentAsync(player, _ => info.Loading = false);
|
||||
LoadTask = LoadComponentAsync(player, _ => MetadataInfo.Loading = false);
|
||||
}
|
||||
|
||||
private void contentIn()
|
||||
@ -350,7 +350,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
private class BeatmapMetadataDisplay : Container
|
||||
protected class BeatmapMetadataDisplay : Container
|
||||
{
|
||||
private class MetadataLine : Container
|
||||
{
|
||||
@ -379,11 +379,12 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
|
||||
private readonly WorkingBeatmap beatmap;
|
||||
private readonly IReadOnlyList<Mod> mods;
|
||||
private readonly Drawable facade;
|
||||
private LoadingAnimation loading;
|
||||
private Sprite backgroundSprite;
|
||||
|
||||
public IReadOnlyList<Mod> Mods { get; }
|
||||
|
||||
public bool Loading
|
||||
{
|
||||
set
|
||||
@ -404,8 +405,9 @@ namespace osu.Game.Screens.Play
|
||||
public BeatmapMetadataDisplay(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods, Drawable facade)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
this.mods = mods;
|
||||
this.facade = facade;
|
||||
|
||||
Mods = mods;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -492,7 +494,7 @@ namespace osu.Game.Screens.Play
|
||||
Origin = Anchor.TopCentre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = new MarginPadding { Top = 20 },
|
||||
Current = { Value = mods }
|
||||
Current = { Value = Mods }
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user