From 5869a4437ddfa66effe16cbe2d1c09817ee71639 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 28 Nov 2020 22:46:50 +1100 Subject: [PATCH] Use Colors.StripUsed instead of Colors.Strip in more places such as /who,/clients, name filter, etc --- GUI/Controls/ColoredTextBox.cs | 2 +- GUI/Popups/CustomCommands.cs | 2 +- MCGalaxy/Chat/ChatTokens.cs | 2 +- MCGalaxy/Commands/Chat/CmdMe.cs | 2 +- MCGalaxy/Commands/Information/CmdPClients.cs | 2 +- MCGalaxy/Commands/Information/CmdPlayers.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GUI/Controls/ColoredTextBox.cs b/GUI/Controls/ColoredTextBox.cs index f9a86712d..b6f4ee10a 100644 --- a/GUI/Controls/ColoredTextBox.cs +++ b/GUI/Controls/ColoredTextBox.cs @@ -98,7 +98,7 @@ namespace MCGalaxy.Gui.Components { if (dateStamp) AppendColoredText(CurrentDate, Color.Gray); if (!Colorize) { - AppendText(Colors.Strip(text)); + AppendText(Colors.StripUsed(text)); } else { AppendFormatted(text, color); } diff --git a/GUI/Popups/CustomCommands.cs b/GUI/Popups/CustomCommands.cs index 9c4cdd23f..3e602d6cd 100644 --- a/GUI/Popups/CustomCommands.cs +++ b/GUI/Popups/CustomCommands.cs @@ -78,7 +78,7 @@ namespace MCGalaxy.Gui.Popups { CompilerResults result = engine.Compile(fileName, args, p); if (result.Errors.HasErrors) { - string body = "\r\n\r\n" + Colors.Strip(p.Messages); + string body = "\r\n\r\n" + Colors.StripUsed(p.Messages); Popup.Error("Compilation error. See logs/errors/compiler.log for more details." + body); return; } diff --git a/MCGalaxy/Chat/ChatTokens.cs b/MCGalaxy/Chat/ChatTokens.cs index 6c2d48229..0ac5883a8 100644 --- a/MCGalaxy/Chat/ChatTokens.cs +++ b/MCGalaxy/Chat/ChatTokens.cs @@ -118,7 +118,7 @@ namespace MCGalaxy { return count.ToString(); } - static string TokenName(Player p) { return (Server.Config.DollarNames ? "$" : "") + Colors.Strip(p.DisplayName); } + static string TokenName(Player p) { return (Server.Config.DollarNames ? "$" : "") + Colors.StripUsed(p.DisplayName); } static string TokenTrueName(Player p) { return (Server.Config.DollarNames ? "$" : "") + p.truename; } static string TokenColor(Player p) { return p.color; } static string TokenRank(Player p) { return p.group.Name; } diff --git a/MCGalaxy/Commands/Chat/CmdMe.cs b/MCGalaxy/Commands/Chat/CmdMe.cs index 05eee7606..21ba259ef 100644 --- a/MCGalaxy/Commands/Chat/CmdMe.cs +++ b/MCGalaxy/Commands/Chat/CmdMe.cs @@ -29,7 +29,7 @@ namespace MCGalaxy.Commands.Chatting { if (message.Length == 0) { p.Message("You"); return; } if (p.joker) { p.Message("Cannot use /me while jokered."); return; } - string msg = p.color + "*" + Colors.Strip(p.DisplayName) + " " + message; + string msg = p.color + "*" + Colors.StripUsed(p.DisplayName) + " " + message; if (TryMessage(p, msg)) OnPlayerActionEvent.Call(p, PlayerAction.Me, message); } diff --git a/MCGalaxy/Commands/Information/CmdPClients.cs b/MCGalaxy/Commands/Information/CmdPClients.cs index 212e01a1a..73543edb5 100644 --- a/MCGalaxy/Commands/Information/CmdPClients.cs +++ b/MCGalaxy/Commands/Information/CmdPClients.cs @@ -49,7 +49,7 @@ namespace MCGalaxy.Commands.Info { List players = kvp.Value; for (int i = 0; i < players.Count; i++) { - string nick = Colors.Strip(p.FormatNick(players[i])); + string nick = Colors.StripUsed(p.FormatNick(players[i])); builder.Append(nick); if (i < players.Count - 1) builder.Append(", "); } diff --git a/MCGalaxy/Commands/Information/CmdPlayers.cs b/MCGalaxy/Commands/Information/CmdPlayers.cs index 7c2ee93e4..24d2b2da2 100644 --- a/MCGalaxy/Commands/Information/CmdPlayers.cs +++ b/MCGalaxy/Commands/Information/CmdPlayers.cs @@ -76,7 +76,7 @@ namespace MCGalaxy.Commands.Info { StringBuilder data = list.builder; data.Append(' '); if (p.voice) { data.Append("&f+").Append(list.group.Color); } - data.Append(Colors.Strip(target.FormatNick(p))); + data.Append(Colors.StripUsed(target.FormatNick(p))); if (p.hidden) data.Append("-hidden"); if (p.muted) data.Append("-muted");