mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 16:47:19 +09:00
Fix beatmap carousel test failures
This commit is contained in:
parent
a0f8debafe
commit
41d90cd0b5
@ -698,10 +698,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
for (int i = 1; i <= 15; i++)
|
for (int i = 1; i <= 15; i++)
|
||||||
{
|
{
|
||||||
set.Beatmaps.Add(new BeatmapInfo
|
set.Beatmaps.Add(new BeatmapInfo(new OsuRuleset().RulesetInfo, new BeatmapDifficulty(), new BeatmapMetadata())
|
||||||
{
|
{
|
||||||
DifficultyName = $"Stars: {i}",
|
DifficultyName = $"Stars: {i}",
|
||||||
Ruleset = new OsuRuleset().RulesetInfo,
|
|
||||||
StarRating = i,
|
StarRating = i,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -98,10 +98,16 @@ namespace osu.Game.Screens.Select
|
|||||||
private IEnumerable<CarouselBeatmapSet> beatmapSets => root.Children.OfType<CarouselBeatmapSet>();
|
private IEnumerable<CarouselBeatmapSet> beatmapSets => root.Children.OfType<CarouselBeatmapSet>();
|
||||||
|
|
||||||
// todo: only used for testing, maybe remove.
|
// todo: only used for testing, maybe remove.
|
||||||
|
private bool loadedTestBeatmaps;
|
||||||
|
|
||||||
public IEnumerable<BeatmapSetInfo> BeatmapSets
|
public IEnumerable<BeatmapSetInfo> BeatmapSets
|
||||||
{
|
{
|
||||||
get => beatmapSets.Select(g => g.BeatmapSet);
|
get => beatmapSets.Select(g => g.BeatmapSet);
|
||||||
set => loadBeatmapSets(value);
|
set
|
||||||
|
{
|
||||||
|
loadedTestBeatmaps = true;
|
||||||
|
loadBeatmapSets(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadBeatmapSets(IEnumerable<BeatmapSetInfo> beatmapSets)
|
private void loadBeatmapSets(IEnumerable<BeatmapSetInfo> beatmapSets)
|
||||||
@ -190,6 +196,10 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private void beatmapSetsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet changes, Exception error)
|
private void beatmapSetsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet changes, Exception error)
|
||||||
{
|
{
|
||||||
|
// If loading test beatmaps, avoid overwriting with realm subscription callbacks.
|
||||||
|
if (loadedTestBeatmaps)
|
||||||
|
return;
|
||||||
|
|
||||||
if (changes == null)
|
if (changes == null)
|
||||||
{
|
{
|
||||||
// initial load
|
// initial load
|
||||||
|
Loading…
x
Reference in New Issue
Block a user