1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 19:24:24 +08:00

Merge pull request #33607 from peppy/ssv2-show-full-mod-details-footer

SongSelectV2: Show full mod details in footer
This commit is contained in:
Bartłomiej Dach
2025-06-10 11:21:50 +02:00
committed by GitHub
Unverified
+46 -22
View File
@@ -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 ModCountText 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,7 @@ namespace osu.Game.Screens.SelectV2
Current = { BindTarget = Current },
ExpansionMode = ExpansionMode.AlwaysContracted,
},
modCountText = 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 }, },
}
},
}
@@ -198,7 +194,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 +204,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 +222,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,17 +236,52 @@ namespace osu.Game.Screens.SelectV2
multiplierText.FadeColour(Color4.White, duration, easing);
}
private partial class ModCountText : OsuSpriteText, IHasCustomTooltip<IReadOnlyList<Mod>>
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 : CompositeDrawable, IHasCustomTooltip<IReadOnlyList<Mod>>
{
public readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>();
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<IReadOnlyList<Mod>> GetCustomTooltip() => new ModOverflowTooltip(colourProvider);