mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
ConsoleIO: fix timestamp & BasicIO-NoColor (#2076)
* ConsoleIO: correct BasicIO-NoColor handling We need color code stripped string in place of original string, not appending to it * ConsoleIO: fix timestamp order Timestamp should come before the string, not after. * ConsoleIO: check BasicIO-NoColor only when BasicIO
This commit is contained in:
parent
a8bbb1ac76
commit
78dd3ea17e
1 changed files with 11 additions and 10 deletions
|
|
@ -123,32 +123,33 @@ namespace MinecraftClient
|
|||
|
||||
if (!String.IsNullOrEmpty(str))
|
||||
{
|
||||
if (!acceptnewlines)
|
||||
{
|
||||
output.Append(str.Replace('\n', ' '));
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Append(str);
|
||||
}
|
||||
if (displayTimestamp == null)
|
||||
if (displayTimestamp == null)
|
||||
{
|
||||
displayTimestamp = EnableTimestamps;
|
||||
}
|
||||
if (displayTimestamp.Value)
|
||||
if (displayTimestamp.Value)
|
||||
{
|
||||
int hour = DateTime.Now.Hour, minute = DateTime.Now.Minute, second = DateTime.Now.Second;
|
||||
output.Append(String.Format("{0}:{1}:{2} ", hour.ToString("00"), minute.ToString("00"), second.ToString("00")));
|
||||
}
|
||||
if (!acceptnewlines)
|
||||
{
|
||||
str = str.Replace('\n', ' ');
|
||||
}
|
||||
if (BasicIO)
|
||||
{
|
||||
if (BasicIO_NoColor)
|
||||
{
|
||||
output.Append(ChatBot.GetVerbatim(str));
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Append(str);
|
||||
}
|
||||
Console.WriteLine(output.ToString());
|
||||
return;
|
||||
}
|
||||
output.Append(str);
|
||||
ConsoleInteractive.ConsoleWriter.WriteLineFormatted(output.ToString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue