mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
refactor: simplify color handling in ClassicConsoleBackend
- Removed hex color handling logic from ClassicConsoleBackend, streamlining the WriteLineFormatted method. - Updated ColorHelper to ensure consistent formatting for color codes. - Ensured console-specific settings are reapplied after backend initialization in Program.cs.
This commit is contained in:
parent
64c42bb4b5
commit
ff00d01fd7
3 changed files with 9 additions and 23 deletions
|
|
@ -202,6 +202,11 @@ namespace MinecraftClient
|
|||
{
|
||||
ConsoleIO.Backend = new ClassicConsoleBackend();
|
||||
ConsoleIO.Backend.Init();
|
||||
|
||||
// Config deserialization triggers OnSettingUpdate before the backend
|
||||
// exists, so console-specific settings (UseVT100ColorCode, colors, etc.)
|
||||
// are never applied. Re-apply them now that the backend is ready.
|
||||
Config.Console.OnSettingUpdate();
|
||||
}
|
||||
|
||||
if (!ProcessStartupState(startupState))
|
||||
|
|
@ -240,6 +245,7 @@ namespace MinecraftClient
|
|||
|
||||
ConsoleIO.Backend = new ClassicConsoleBackend();
|
||||
ConsoleIO.Backend.Init();
|
||||
Config.Console.OnSettingUpdate();
|
||||
|
||||
ConsoleIO.WriteLineFormatted("§c" + Translations.mcc_tui_startup_failed);
|
||||
ConsoleIO.WriteLine(exception.ToString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue