1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 16:27:43 +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,9 +76,14 @@ namespace osu.Game.Skinning.Components
foreach (var type in Enum.GetValues<BeatmapAttribute>()) foreach (var type in Enum.GetValues<BeatmapAttribute>())
{ {
numberedTemplate = numberedTemplate.Replace($"{{{{{type}}}}}", $"{{{values.Count}}}"); string replaced = numberedTemplate.Replace($@"{{{{{type}}}}}", $@"{{{values.Count}}}");
if (numberedTemplate != replaced)
{
numberedTemplate = replaced;
values.Add(getValueString(type)); values.Add(getValueString(type));
} }
}
text.Text = LocalisableString.Format(numberedTemplate, values.ToArray()); text.Text = LocalisableString.Format(numberedTemplate, values.ToArray());
} }