diff --git a/CLI/CLIProgram.cs b/CLI/CLIProgram.cs index 003ceda5d..8b3cc1fae 100644 --- a/CLI/CLIProgram.cs +++ b/CLI/CLIProgram.cs @@ -131,10 +131,11 @@ namespace MCGalaxy.Cli { message = UIHelpers.Format(message); while (index < message.Length) { + char curCol = col; string part = UIHelpers.OutputPart(ref col, ref index, message); if (part.Length > 0) { - Console.ForegroundColor = GetConsoleCol(col); - Console.Write(message); + Console.ForegroundColor = GetConsoleCol(curCol); + Console.Write(part); } } } diff --git a/GUI/ColoredTextBox.cs b/GUI/ColoredTextBox.cs index c5b3771a2..6438117f4 100644 --- a/GUI/ColoredTextBox.cs +++ b/GUI/ColoredTextBox.cs @@ -168,8 +168,9 @@ namespace MCGalaxy.Gui.Components { message = UIHelpers.Format(message); while (index < message.Length) { + char curCol = col; string part = UIHelpers.OutputPart(ref col, ref index, message); - if (part.Length > 0) AppendColoredText(part, GetCol(col, foreColor)); + if (part.Length > 0) AppendColoredText(part, GetCol(curCol, foreColor)); } } diff --git a/MCGalaxy/Commands/World/CmdMap.cs b/MCGalaxy/Commands/World/CmdMap.cs index b80fa6ec4..c1518d2c4 100644 --- a/MCGalaxy/Commands/World/CmdMap.cs +++ b/MCGalaxy/Commands/World/CmdMap.cs @@ -134,7 +134,7 @@ namespace MCGalaxy.Commands.World { public override void Help(Player p) { Player.Message(p, "%T/Map [level] [option] %H- Sets [option] on [level]"); Player.Message(p, "%HPossible options: %S{0}", LevelOptions.Options.Keys.Join()); - Player.Message(p, "%HUse %T/Help map [option] %Hto see a description for that option."); + Player.Message(p, "%HUse %T/Help map [option] %Hto see description for that option."); } public override void Help(Player p, string message) { diff --git a/MCGalaxy/util/UIHelpers.cs b/MCGalaxy/util/UIHelpers.cs index 05c408893..edb0cd8df 100644 --- a/MCGalaxy/util/UIHelpers.cs +++ b/MCGalaxy/util/UIHelpers.cs @@ -96,7 +96,7 @@ namespace MCGalaxy.UI { return message; } - public static string OutputPart(ref char col, ref int start, string message) { + public static string OutputPart(ref char nextCol, ref int start, string message) { int next = NextPart(start, message); string part; if (next == -1) { @@ -105,7 +105,7 @@ namespace MCGalaxy.UI { } else { part = message.Substring(start, next - start); start = next + 2; - col = message[next + 1]; + nextCol = message[next + 1]; } return part; }