Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial carousel additions in preparation for selection logic #31632

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Show selection defaults in test scene (and make prettier)
peppy committed Jan 23, 2025

Verified

This commit was signed with the committer’s verified signature.
peppy Dean Herbert
commit 865757621082cb3e2cba36a7f6a5dbd5d71d74a4
39 changes: 26 additions & 13 deletions osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarouselV2.cs
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.Select;
using osu.Game.Screens.Select.Filter;
@@ -117,12 +118,11 @@ public void SetUpSteps()
}
}
},
stats = new OsuTextFlowContainer(cp => cp.Font = FrameworkFont.Regular.With())
stats = new OsuTextFlowContainer
{
AutoSizeAxes = Axes.Both,
Padding = new MarginPadding(10),
TextAnchor = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
};
});
@@ -258,16 +258,29 @@ private void updateStats()
if (carousel.IsNull())
return;

stats.Text = $"""
store
sets: {beatmapSets.Count}
beatmaps: {beatmapCount}
carousel:
sorting: {carousel.IsFiltering}
tracked: {carousel.ItemsTracked}
displayable: {carousel.DisplayableItems}
displayed: {carousel.VisibleItems}
""";
stats.Clear();
createHeader("beatmap store");
stats.AddParagraph($"""
sets: {beatmapSets.Count}
beatmaps: {beatmapCount}
""");
createHeader("carousel");
stats.AddParagraph($"""
sorting: {carousel.IsFiltering}
tracked: {carousel.ItemsTracked}
displayable: {carousel.DisplayableItems}
displayed: {carousel.VisibleItems}
selected: {carousel.CurrentSelection}
""");

void createHeader(string text)
{
stats.AddParagraph(string.Empty);
stats.AddParagraph(text, cp =>
{
cp.Font = cp.Font.With(size: 18, weight: FontWeight.Bold);
});
}
}
}
}