mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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:
parent
7bf342baab
commit
1a1caec30a
6 changed files with 12 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ namespace MinecraftClient.Tui
|
|||
{
|
||||
_logLines.Clear();
|
||||
_logControls.Clear();
|
||||
ScheduleScrollToEnd();
|
||||
}
|
||||
|
||||
private void TrimLog()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue