mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Update tests to account for correct beatmap displaying on details area
This commit is contained in:
parent
398d90ee52
commit
02514d4228
@ -51,11 +51,12 @@ namespace osu.Game.Tests.Visual
|
||||
private class TestSongSelect : PlaySongSelect
|
||||
{
|
||||
public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
|
||||
public WorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
|
||||
public new BeatmapCarousel Carousel => base.Carousel;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapManager baseManager)
|
||||
private void load(OsuGameBase game)
|
||||
{
|
||||
TestSongSelect songSelect = null;
|
||||
|
||||
@ -69,12 +70,16 @@ namespace osu.Game.Tests.Visual
|
||||
dependencies.Cache(rulesets = new RulesetStore(contextFactory));
|
||||
dependencies.Cache(manager = new BeatmapManager(storage, contextFactory, rulesets, null)
|
||||
{
|
||||
DefaultBeatmap = defaultBeatmap = baseManager.GetWorkingBeatmap(null)
|
||||
DefaultBeatmap = defaultBeatmap = game.Beatmap.Default
|
||||
});
|
||||
|
||||
void loadNewSongSelect(bool deleteMaps = false) => AddStep("reload song select", () =>
|
||||
{
|
||||
if (deleteMaps) manager.DeleteAll();
|
||||
if (deleteMaps)
|
||||
{
|
||||
manager.DeleteAll();
|
||||
game.Beatmap.SetDefault();
|
||||
}
|
||||
|
||||
if (songSelect != null)
|
||||
{
|
||||
@ -91,6 +96,8 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap);
|
||||
|
||||
AddAssert("dummy shown on wedge", () => songSelect.CurrentBeatmapDetailsBeatmap == defaultBeatmap);
|
||||
|
||||
AddStep("import test maps", () =>
|
||||
{
|
||||
for (int i = 0; i < 100; i += 10)
|
||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
private OsuScreen player;
|
||||
private readonly ModSelectOverlay modSelect;
|
||||
private readonly BeatmapDetailArea beatmapDetails;
|
||||
protected readonly BeatmapDetailArea BeatmapDetails;
|
||||
private bool removeAutoModOnResume;
|
||||
|
||||
public PlaySongSelect()
|
||||
@ -35,13 +35,13 @@ namespace osu.Game.Screens.Select
|
||||
Anchor = Anchor.BottomCentre,
|
||||
});
|
||||
|
||||
LeftContent.Add(beatmapDetails = new BeatmapDetailArea
|
||||
LeftContent.Add(BeatmapDetails = new BeatmapDetailArea
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Top = 10, Right = 5 },
|
||||
});
|
||||
|
||||
beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
|
||||
BeatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
|
||||
}
|
||||
|
||||
private SampleChannel sampleConfirm;
|
||||
@ -78,7 +78,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||
|
||||
beatmapDetails.Beatmap = beatmap;
|
||||
BeatmapDetails.Beatmap = beatmap;
|
||||
|
||||
if (beatmap.Track != null)
|
||||
beatmap.Track.Looping = true;
|
||||
|
Loading…
Reference in New Issue
Block a user