1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Tidy up code

This commit is contained in:
Dean Herbert 2022-11-30 14:31:54 +09:00
parent b5c514a8f0
commit 2df6ccf33e

View File

@ -68,6 +68,9 @@ namespace osu.Game.Online.Chat
break;
}
channelManager.PostMessage($"is {verb} {getBeatmapPart()} {getModPart()}", true, target);
Expire();
string getBeatmapPart()
{
string beatmapInfoString = localisation.GetLocalisedBindableString(beatmapInfo.GetDisplayTitleRomanisable()).Value;
@ -84,23 +87,20 @@ namespace osu.Game.Online.Chat
return string.Empty;
}
StringBuilder modS = new StringBuilder();
StringBuilder modsString = new StringBuilder();
foreach (var mod in selectedMods.Value.Where(mod => mod.Type == ModType.DifficultyIncrease))
{
modS.Append($"+{mod.Acronym} ");
modsString.Append($"+{mod.Acronym} ");
}
foreach (var mod in selectedMods.Value.Where(mod => mod.Type != ModType.DifficultyIncrease))
{
modS.Append($"-{mod.Acronym} ");
modsString.Append($"-{mod.Acronym} ");
}
return modS.ToString();
return modsString.ToString().Trim();
}
channelManager.PostMessage($"is {verb} {getBeatmapPart()} {getModPart()}", true, target);
Expire();
}
}
}