1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-21 16:40:30 +08:00

Merge pull request #35821 from smoogipoo/qp-adjust-pool-selector

Display quick play pool name as sub-heading in selector
This commit is contained in:
Bartłomiej Dach
2025-11-27 12:16:02 +01:00
committed by GitHub
Unverified
2 changed files with 33 additions and 16 deletions
@@ -22,11 +22,11 @@ namespace osu.Game.Tests.Visual.Matchmaking
{
Value =
[
new MatchmakingPool { Id = 0, RulesetId = 0, Name = "osu!" },
new MatchmakingPool { Id = 1, RulesetId = 1, Name = "osu!taiko" },
new MatchmakingPool { Id = 2, RulesetId = 2, Name = "osu!catch" },
new MatchmakingPool { Id = 3, RulesetId = 3, Variant = 4, Name = "osu!mania (4k)" },
new MatchmakingPool { Id = 4, RulesetId = 3, Variant = 7, Name = "osu!mania (7k)" },
new MatchmakingPool { Id = 0, RulesetId = 0, Name = "Free-for-all" },
new MatchmakingPool { Id = 1, RulesetId = 1, Name = "1v1" },
new MatchmakingPool { Id = 2, RulesetId = 2, Name = "1v1" },
new MatchmakingPool { Id = 3, RulesetId = 3, Variant = 4, Name = "1v1" },
new MatchmakingPool { Id = 4, RulesetId = 3, Variant = 7, Name = "1v1" },
]
}
});
@@ -92,7 +92,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
private partial class SelectorButton : OsuAnimatedButton
{
public static readonly Vector2 SIZE = new Vector2(84, 64);
public static readonly Vector2 SIZE = new Vector2(84, 78);
public bool IsSelected => SelectedPool.Value?.Equals(pool) == true;
@@ -106,8 +106,6 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
private Box flashLayer = null!;
private OsuSpriteText text = null!;
public SelectorButton(MatchmakingPool pool)
: base(HoverSampleSet.ButtonSidebar)
{
@@ -123,6 +121,12 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
Content.CornerRadius = 16;
Content.CornerExponent = 10;
Ruleset? rulesetInstance = rulesetStore.GetRuleset(pool.RulesetId)?.CreateInstance();
string rulesetName = rulesetInstance?.Description ?? string.Empty;
if (pool.Variant != 0)
rulesetName += $" {pool.Variant}K";
Children = new Drawable[]
{
new Box
@@ -156,13 +160,28 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
iconSprite = createIcon(),
}
},
text = new OsuSpriteText
new FillFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.Style.Caption2,
Text = pool.Name,
},
RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.Style.Caption1.With(weight: FontWeight.Bold),
Text = rulesetName,
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.Style.Caption2,
Text = pool.Name
}
}
}
}
},
};
@@ -198,14 +217,12 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
{
this.ScaleTo(1.2f, 200, Easing.OutQuint);
iconSprite.FadeColour(Color4.Gold, 100, Easing.OutQuint);
text.Font = text.Font.With(weight: FontWeight.Bold);
flashLayer.FadeTo(0.1f, 200, Easing.OutQuint);
}
else
{
this.ScaleTo(1f, 200, Easing.OutQuint);
iconSprite.FadeColour(OsuColour.Gray(0.5f), 100);
text.Font = text.Font.With(weight: FontWeight.Regular);
flashLayer.FadeOut(200, Easing.OutQuint);
}
}