mirror of
https://github.com/ppy/osu.git
synced 2025-01-29 02:52:54 +08:00
Merge pull request #5821 from iiSaLMaN/wrap-difficulty-icons-for-beatmap-set-overlay
Fix difficulty icons not wrapping correctly in beatmap set overlay
This commit is contained in:
commit
84ae0211e0
@ -135,6 +135,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
});
|
});
|
||||||
|
|
||||||
downloadAssert(true);
|
downloadAssert(true);
|
||||||
|
|
||||||
|
AddStep("show many difficulties", () => overlay.ShowBeatmapSet(createManyDifficultiesBeatmapSet()));
|
||||||
|
downloadAssert(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -222,6 +225,56 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep(@"show without reload", overlay.Show);
|
AddStep(@"show without reload", overlay.Show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BeatmapSetInfo createManyDifficultiesBeatmapSet()
|
||||||
|
{
|
||||||
|
var beatmaps = new List<BeatmapInfo>();
|
||||||
|
|
||||||
|
for (int i = 1; i < 41; i++)
|
||||||
|
{
|
||||||
|
beatmaps.Add(new BeatmapInfo
|
||||||
|
{
|
||||||
|
OnlineBeatmapID = i * 10,
|
||||||
|
Version = $"Test #{i}",
|
||||||
|
Ruleset = Ruleset.Value,
|
||||||
|
StarDifficulty = 2 + i * 0.1,
|
||||||
|
BaseDifficulty = new BeatmapDifficulty
|
||||||
|
{
|
||||||
|
OverallDifficulty = 3.5f,
|
||||||
|
},
|
||||||
|
OnlineInfo = new BeatmapOnlineInfo(),
|
||||||
|
Metrics = new BeatmapMetrics
|
||||||
|
{
|
||||||
|
Fails = Enumerable.Range(1, 100).Select(j => j % 12 - 6).ToArray(),
|
||||||
|
Retries = Enumerable.Range(-2, 100).Select(j => j % 12 - 6).ToArray(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return new BeatmapSetInfo
|
||||||
|
{
|
||||||
|
OnlineBeatmapSetID = 123,
|
||||||
|
Metadata = new BeatmapMetadata
|
||||||
|
{
|
||||||
|
Title = @"many difficulties beatmap",
|
||||||
|
Artist = @"none",
|
||||||
|
Author = new User
|
||||||
|
{
|
||||||
|
Username = @"BanchoBot",
|
||||||
|
Id = 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Preview = @"https://b.ppy.sh/preview/123.mp3",
|
||||||
|
HasVideo = true,
|
||||||
|
HasStoryboard = true,
|
||||||
|
Covers = new BeatmapSetOnlineCovers(),
|
||||||
|
},
|
||||||
|
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
|
||||||
|
Beatmaps = beatmaps,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private void downloadAssert(bool shown)
|
private void downloadAssert(bool shown)
|
||||||
{
|
{
|
||||||
AddAssert($"is download button {(shown ? "shown" : "hidden")}", () => overlay.DownloadButtonsVisible == shown);
|
AddAssert($"is download button {(shown ? "shown" : "hidden")}", () => overlay.DownloadButtonsVisible == shown);
|
||||||
|
@ -91,7 +91,8 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
{
|
{
|
||||||
difficulties = new DifficultiesContainer
|
difficulties = new DifficultiesContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
Margin = new MarginPadding { Left = -(tile_icon_padding + tile_spacing / 2) },
|
Margin = new MarginPadding { Left = -(tile_icon_padding + tile_spacing / 2) },
|
||||||
OnLostHover = () =>
|
OnLostHover = () =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user