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

Add ruleset icon to expanded score panel #31815

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Feb 6, 2025

Not entirely sure we need this, but now that scores in multiplayer can be played on arbitrary rulesets I think it makes sense to display this somewhere. It sits between the star rating and mod displays:

image

What about the contracted panel?

I haven't added it to the contracted panel because I don't know where to fit it in. Also the beatmap isn't displayed there (which is also per-user in freestyle rooms), and I just think the design is in general inadequate for displaying so much info? Here's one of my attempts:

diff --git a/osu.Game/Screens/Ranking/Contracted/ContractedPanelMiddleContent.cs b/osu.Game/Screens/Ranking/Contracted/ContractedPanelMiddleContent.cs
index cfb6465e62..b2709670a0 100644
--- a/osu.Game/Screens/Ranking/Contracted/ContractedPanelMiddleContent.cs
+++ b/osu.Game/Screens/Ranking/Contracted/ContractedPanelMiddleContent.cs
@@ -11,13 +11,15 @@
 using osu.Framework.Graphics.Effects;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Localisation;
+using osu.Game.Beatmaps.Drawables;
 using osu.Game.Graphics;
 using osu.Game.Graphics.Sprites;
 using osu.Game.Online.Leaderboards;
 using osu.Game.Resources.Localisation.Web;
+using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Scoring;
+using osu.Game.Rulesets.UI;
 using osu.Game.Scoring;
-using osu.Game.Screens.Play.HUD;
 using osu.Game.Users;
 using osu.Game.Users.Drawables;
 using osu.Game.Utils;
@@ -134,14 +136,33 @@ private void load()
                                                 createStatistic(BeatmapsetsStrings.ShowScoreboardHeadersAccuracy, $"{score.Accuracy.FormatAccuracy()}"),
                                             }
                                         },
-                                        new ModFlowDisplay
+                                        new FillFlowContainer
                                         {
                                             Anchor = Anchor.TopCentre,
                                             Origin = Anchor.TopCentre,
-                                            AutoSizeAxes = Axes.Y,
                                             RelativeSizeAxes = Axes.X,
-                                            Current = { Value = score.Mods },
-                                            IconScale = 0.5f,
+                                            AutoSizeAxes = Axes.Y,
+                                            Direction = FillDirection.Full,
+                                            Spacing = new Vector2(3),
+                                            ChildrenEnumerable =
+                                            [
+                                                new DifficultyIcon(score.BeatmapInfo!, score.Ruleset)
+                                                {
+                                                    Anchor = Anchor.TopCentre,
+                                                    Origin = Anchor.TopCentre,
+                                                    Size = new Vector2(20),
+                                                    TooltipType = DifficultyIconTooltipType.Extended,
+                                                    Margin = new MarginPadding { Right = 2 }
+                                                },
+                                                ..
+                                                score.Mods.AsOrdered().Select(m => new ModIcon(m)
+                                                {
+                                                    Anchor = Anchor.TopCentre,
+                                                    Origin = Anchor.TopCentre,
+                                                    Scale = new Vector2(0.3f),
+                                                    Margin = new MarginPadding { Top = -6 }
+                                                })
+                                            ]
                                         }
                                     }
                                 }
image

Also tried a little bit of a more wanky direction (check the top of the panel), but I'm not pleased with how it looks:

image

Would probably need some direction from @ppy/team-design.

@peppy
Copy link
Member

peppy commented Feb 7, 2025

For the contracted panel, I think displaying it where you have it looks fine, but might not if there are too many mods. Another location would be next to the rank grade at the bottom, but I'd only want it there in the case where the results screen didn't have all scores from the same ruleset (which maybe says that it's not a good place to have it, I dunno).

@peppy peppy self-requested a review February 7, 2025 05:14
@peppy
Copy link
Member

peppy commented Feb 7, 2025

Going to apply your patch to contracted panels as I think it's a good first step. Functionality over design for now.

I think a future effort could see these icons only displaying on users with overrides from the ResultsScreen beatmap / ruleset.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 7, 2025
@peppy peppy merged commit 0235928 into ppy:master Feb 7, 2025
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants