Polish console chat visibility implementation

Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/159bd460-7950-4afe-9e69-4892220665e1

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-04 11:36:01 +00:00 committed by GitHub
parent 7bf342baab
commit 1a1caec30a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 9 deletions

View file

@ -164,7 +164,7 @@ namespace MinecraftClient
/// <summary>
/// Write a formatted chat line to the console when chat output is enabled.
/// </summary>
public static void WriteChatLineFormatted(string str, bool acceptnewlines = false, bool? displayTimestamp = null)
public static void WriteChatLineIfVisible(string str, bool acceptnewlines = false, bool? displayTimestamp = null)
{
if (!ChatVisible)
return;
@ -206,11 +206,13 @@ namespace MinecraftClient
{
Console.Clear();
}
catch (IOException)
catch (IOException ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
catch (PlatformNotSupportedException)
catch (PlatformNotSupportedException ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
return;

View file

@ -72,7 +72,7 @@ namespace MinecraftClient.Logger
{
if (ShouldDisplay(FilterChannel.Chat, msg))
{
ConsoleIO.WriteChatLineFormatted(msg);
ConsoleIO.WriteChatLineIfVisible(msg);
Save(msg);
}
else Debug("[Logger] One Chat message filtered: " + msg);

View file

@ -81,7 +81,7 @@ namespace MinecraftClient.Logger
{
if (ShouldDisplay(FilterChannel.Chat, msg))
{
ConsoleIO.WriteChatLineFormatted(msg);
ConsoleIO.WriteChatLineIfVisible(msg);
}
else Debug("[Logger] One Chat message filtered: " + msg);
}

View file

@ -3043,7 +3043,7 @@ namespace MinecraftClient {
}
/// <summary>
/// Looks up a localized string similar to Console chat output is now hidden.
/// Looks up a localized string similar to Console chat output is now hidden..
/// </summary>
internal static string cmd_console_chat_state_off {
get {
@ -3052,7 +3052,7 @@ namespace MinecraftClient {
}
/// <summary>
/// Looks up a localized string similar to Console chat output is now visible.
/// Looks up a localized string similar to Console chat output is now visible..
/// </summary>
internal static string cmd_console_chat_state_on {
get {

View file

@ -1094,10 +1094,10 @@ Change EnableEmoji=false in the settings if the display is confusing.</value>
<value>toggle chat visibility in the console.</value>
</data>
<data name="cmd.console_chat.state_off" xml:space="preserve">
<value>Console chat output is now hidden</value>
<value>Console chat output is now hidden.</value>
</data>
<data name="cmd.console_chat.state_on" xml:space="preserve">
<value>Console chat output is now visible</value>
<value>Console chat output is now visible.</value>
</data>
<data name="cmd.clear_console.desc" xml:space="preserve">
<value>clear the console output.</value>

View file

@ -272,6 +272,7 @@ namespace MinecraftClient.Tui
{
_logLines.Clear();
_logControls.Clear();
ScheduleScrollToEnd();
}
private void TrimLog()