diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index ef755b6239..93f8a3c2b7 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -482,25 +482,25 @@ namespace osu.Game.Overlays if (postText[0] == '/') { - postText = postText.Substring(1); - string commandKeyword = postText.Split(' ')[0]; + string unhandeledParameters = postText.Substring(1); + string commandKeyword = cutFirstParameter(ref unhandeledParameters); switch (commandKeyword) { case "me": - if (!postText.StartsWith("me ") || string.IsNullOrWhiteSpace(postText.Substring(3))) + if (string.IsNullOrWhiteSpace(unhandeledParameters)) { currentChannel.AddNewMessages(new ErrorMessage("Usage: /me [action]")); return; } isAction = true; - postText = postText.Substring(3); + postText = unhandeledParameters; break; case "help": - currentChannel.AddNewMessages(new ErrorMessage("Supported commands: /help, /me [action]")); + currentChannel.AddNewMessages(new InfoMessage("Supported commands: /help, /me [action]")); return; default: @@ -528,6 +528,13 @@ namespace osu.Game.Overlays api.Queue(req); } + private string cutFirstParameter(ref string parameters) + { + string result = parameters.Split(' ')[0]; + parameters = result.Length == parameters.Length ? "" : parameters.Substring(result.Length + 1); + return result; + } + private void transformChatHeightTo(double newChatHeight, double duration = 0, Easing easing = Easing.None) { this.TransformTo(this.PopulateTransform(new TransformChatHeight(), newChatHeight, duration, easing)); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2d286fe1b8..1679c53ff9 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -372,6 +372,7 @@ +