From f16a7309f8975df2a98b81be4927dbca74d0f824 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Jun 2025 15:33:52 +0900 Subject: [PATCH 1/2] SongSelectV2: Show full mod details in footer User feedback is that it's no longer possible to see the applied rate adjust change when it's non-default without hovering. This fixes that issue. I've adjusted the visuals a bit so you can still get a hint at which mods are displayed, even when they are overflowing. --- osu.Game/Screens/SelectV2/FooterButtonMods.cs | 60 +++++++++++++------ 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/SelectV2/FooterButtonMods.cs b/osu.Game/Screens/SelectV2/FooterButtonMods.cs index 9e2b53012a..f38d6d9376 100644 --- a/osu.Game/Screens/SelectV2/FooterButtonMods.cs +++ b/osu.Game/Screens/SelectV2/FooterButtonMods.cs @@ -52,10 +52,13 @@ namespace osu.Game.Screens.SelectV2 private Drawable unrankedBadge = null!; private ModDisplay modDisplay = null!; - private OsuSpriteText modCountText = null!; private OsuSpriteText multiplierText { get; set; } = null!; + private Container modContainer = null!; + + private Container overflowModCountDisplay = null!; + [Resolved] private OsuColour colours { get; set; } = null!; @@ -117,7 +120,7 @@ namespace osu.Game.Screens.SelectV2 Font = OsuFont.Torus.With(size: 14f, weight: FontWeight.Bold) } }, - new Container + modContainer = new Container { CornerRadius = Y_OFFSET, RelativeSizeAxes = Axes.Both, @@ -130,7 +133,7 @@ namespace osu.Game.Screens.SelectV2 Colour = colourProvider.Background3, RelativeSizeAxes = Axes.Both, }, - modDisplay = new ModDisplay(showExtendedInformation: false) + modDisplay = new ModDisplay(showExtendedInformation: true) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -139,14 +142,27 @@ namespace osu.Game.Screens.SelectV2 Current = { BindTarget = Current }, ExpansionMode = ExpansionMode.AlwaysContracted, }, - modCountText = new ModCountText + overflowModCountDisplay = new Container { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Shear = -OsuGame.SHEAR, - Font = OsuFont.Torus.With(size: 14f, weight: FontWeight.Bold), - Mods = { BindTarget = Current }, - } + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + Colour = colourProvider.Background3, + Alpha = 0.8f, + RelativeSizeAxes = Axes.Both, + }, + new ModCountText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Shear = -OsuGame.SHEAR, + Font = OsuFont.Torus.With(size: 14f, weight: FontWeight.Bold), + Mods = { BindTarget = Current }, + } + } + }, } }, } @@ -198,7 +214,7 @@ namespace osu.Game.Screens.SelectV2 modDisplayBar.MoveToY(20, duration, easing); modDisplayBar.FadeOut(duration, easing); modDisplay.FadeOut(duration, easing); - modCountText.FadeOut(duration, easing); + overflowModCountDisplay.FadeOut(duration, easing); unrankedBadge.MoveToY(20, duration, easing); unrankedBadge.FadeOut(duration, easing); @@ -208,14 +224,6 @@ namespace osu.Game.Screens.SelectV2 } else { - modDisplay.Hide(); - modCountText.Hide(); - - if (Current.Value.Count >= 5) - modCountText.Show(); - else - modDisplay.Show(); - if (Current.Value.Any(m => !m.Ranked)) { unrankedBadge.MoveToX(0, duration, easing); @@ -234,6 +242,7 @@ namespace osu.Game.Screens.SelectV2 modDisplayBar.MoveToY(-5, duration, Easing.OutQuint); unrankedBadge.MoveToY(-5, duration, easing); modDisplayBar.FadeIn(duration, easing); + modDisplay.FadeIn(duration, easing); } double multiplier = Current.Value?.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier) ?? 1; @@ -247,6 +256,19 @@ namespace osu.Game.Screens.SelectV2 multiplierText.FadeColour(Color4.White, duration, easing); } + protected override void Update() + { + base.Update(); + + if (Current.Value.Count == 0) + return; + + if (modDisplay.DrawWidth * modDisplay.Scale.X > modContainer.DrawWidth) + overflowModCountDisplay.Show(); + else + overflowModCountDisplay.Hide(); + } + private partial class ModCountText : OsuSpriteText, IHasCustomTooltip> { public readonly Bindable> Mods = new Bindable>(); From 599b4c82365452ff397591c63e6a4f8d24f95da5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Jun 2025 17:17:47 +0900 Subject: [PATCH 2/2] Fix tooltip not being displayed around edges of text content --- osu.Game/Screens/SelectV2/FooterButtonMods.cs | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/osu.Game/Screens/SelectV2/FooterButtonMods.cs b/osu.Game/Screens/SelectV2/FooterButtonMods.cs index f38d6d9376..8ea08a0085 100644 --- a/osu.Game/Screens/SelectV2/FooterButtonMods.cs +++ b/osu.Game/Screens/SelectV2/FooterButtonMods.cs @@ -57,7 +57,7 @@ namespace osu.Game.Screens.SelectV2 private Container modContainer = null!; - private Container overflowModCountDisplay = null!; + private ModCountText overflowModCountDisplay = null!; [Resolved] private OsuColour colours { get; set; } = null!; @@ -142,27 +142,7 @@ namespace osu.Game.Screens.SelectV2 Current = { BindTarget = Current }, ExpansionMode = ExpansionMode.AlwaysContracted, }, - overflowModCountDisplay = new Container - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new Box - { - Colour = colourProvider.Background3, - Alpha = 0.8f, - RelativeSizeAxes = Axes.Both, - }, - new ModCountText - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Shear = -OsuGame.SHEAR, - Font = OsuFont.Torus.With(size: 14f, weight: FontWeight.Bold), - Mods = { BindTarget = Current }, - } - } - }, + overflowModCountDisplay = new ModCountText { Mods = { BindTarget = Current }, }, } }, } @@ -269,17 +249,39 @@ namespace osu.Game.Screens.SelectV2 overflowModCountDisplay.Hide(); } - private partial class ModCountText : OsuSpriteText, IHasCustomTooltip> + private partial class ModCountText : CompositeDrawable, IHasCustomTooltip> { public readonly Bindable> Mods = new Bindable>(); + private OsuSpriteText text = null!; + [Resolved] private OverlayColourProvider colourProvider { get; set; } = null!; protected override void LoadComplete() { base.LoadComplete(); - Mods.BindValueChanged(v => Text = ModSelectOverlayStrings.Mods(v.NewValue.Count).ToUpper(), true); + + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = colourProvider.Background3, + Alpha = 0.8f, + RelativeSizeAxes = Axes.Both, + }, + text = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Font = OsuFont.Torus.With(size: 14f, weight: FontWeight.Bold), + Shear = -OsuGame.SHEAR, + } + }; + + Mods.BindValueChanged(v => text.Text = ModSelectOverlayStrings.Mods(v.NewValue.Count).ToUpper(), true); } public ITooltip> GetCustomTooltip() => new ModOverflowTooltip(colourProvider);