1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 12:27:26 +08:00

Only add as many values as are replaced

This commit is contained in:
Dan Balasescu 2024-10-18 17:16:42 +09:00
parent 8804769da1
commit 2de5e3392e
No known key found for this signature in database

View File

@ -76,8 +76,13 @@ namespace osu.Game.Skinning.Components
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());