Skip to content

Commit

Permalink
Only add as many values as are replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Oct 18, 2024
1 parent 8804769 commit 2de5e33
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions osu.Game/Skinning/Components/BeatmapAttributeText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ private void updateText()

foreach (var type in Enum.GetValues<BeatmapAttribute>())
{
numberedTemplate = numberedTemplate.Replace($"{{{{{type}}}}}", $"{{{values.Count}}}");
values.Add(getValueString(type));
string replaced = numberedTemplate.Replace($@"{{{{{type}}}}}", $@"{{{values.Count}}}");

if (numberedTemplate != replaced)
{
numberedTemplate = replaced;
values.Add(getValueString(type));
}
}

text.Text = LocalisableString.Format(numberedTemplate, values.ToArray());
Expand Down

0 comments on commit 2de5e33

Please sign in to comment.