From 2df6ccf33e2c9b5fa80ebcde33b8c46d126622e4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 Nov 2022 14:31:54 +0900 Subject: [PATCH] Tidy up code --- osu.Game/Online/Chat/NowPlayingCommand.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Online/Chat/NowPlayingCommand.cs b/osu.Game/Online/Chat/NowPlayingCommand.cs index 0e39f5ac91..c65b06c6d8 100644 --- a/osu.Game/Online/Chat/NowPlayingCommand.cs +++ b/osu.Game/Online/Chat/NowPlayingCommand.cs @@ -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(); } } }