Skip to content

Add ranked play division badges - #38989

Open
LiquidPL wants to merge 5 commits into
ppy:masterfrom
LiquidPL:rp-division-badge
Open

LiquidPL wants to merge 5 commits into
ppy:masterfrom
LiquidPL:rp-division-badge

Conversation

@LiquidPL

@LiquidPL LiquidPL commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Requires ppy/osu-resources#440.

This PR adds components rendering both the full and compact variants of the badge displaying the user's division inside of ranked play.

Also includes a proposed DTO for storing division metadata, which I hope will later be used when we get web to serve tier/division data to the client. I prefered doing this over implicitly assuming divisions start at 600, are spaced 100 ELO apart, etc. since the intention is to have this metadata served by web anyway.

Regular badges:

image

Compact badges:

image

Requires ppy/osu-resources#440.

This PR adds components rendering both the full and compact variants of
the badge displaying the user's division inside of ranked play.

Also includes a proposed DTO for storing division metadata, which I hope
will later be used when we get web to serve tier/division data to the
client. I prefered doing this over implicitly assuming divisions start
at 600, are spaced 100 ELO apart, etc. since the intention is to have
this metadata served by web anyway.
}

[JsonConverter(typeof(StringEnumConverter))]
public enum Tier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not put these in the same file as RankedPlayDivision. Maybe RankedPlayTier/RankedPlayDivision so that they're distinct from RankingTier (if we even want this to be separate in the first place).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely missed RankingTier existing, will use that for now. Also will split out the division enum to a separate file and rename the model to APIRankedPlayDivision or something like that (is there a reason some response models have the API prefix and some don't?).

Comment on lines +58 to +84
new Sprite
{
Size = division.Tier switch
{
Tier.Bronze => new Vector2(33),
Tier.Silver => new Vector2(34.5f),
_ => new Vector2(36),
},
Position = division.Tier switch
{
Tier.Bronze => new Vector2(43.5f, 24.75f),
Tier.Silver => new Vector2(42.75f, 27),
Tier.Gold => new Vector2(42, 23.25f),
Tier.Platinum => new Vector2(42, 28.5f),
Tier.Rhodium => new Vector2(42, 30),
Tier.Radiant => new Vector2(42, 33),
Tier.Lustrous => new Vector2(42, 43.5f),
_ => throw new ArgumentOutOfRangeException()
},
Texture = textures.Get($@"Online/RankedPlay/Tiers/Rulesets/{ruleset.ShortName}"),
},
new Sprite
{
RelativeSizeAxes = Axes.Both,
Texture = textures.Get($@"Online/RankedPlay/Tiers/Stars/{division.Key}"),
FillMode = FillMode.Fit,
},

@minetoblend minetoblend Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the shine layer will go above the stars but below the ruleset icon, so probably a good idea to swap the draw order these two

This branch has not been deployed

No deployments
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.

3 participants