mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Add icon banner display option and refactor startup banner logic
- Introduced a configuration option `Display_Icon_Banner` to control the visibility of the startup icon banner. - Refactored `ProcessStartupState` to utilize TUI for displaying the banner if enabled, falling back to a classic banner display otherwise. - Added new methods for building the banner panel and icon grid for improved visual representation. - Updated translations and resource comments to support the new banner features.
This commit is contained in:
parent
6b5435629f
commit
eaf4704473
9 changed files with 2557 additions and 2299 deletions
|
|
@ -228,9 +228,26 @@ namespace MinecraftClient
|
|||
/// <returns>True if startup can continue; false if config load failed and user chose to exit.</returns>
|
||||
internal static bool ProcessStartupState(StartupState state)
|
||||
{
|
||||
ConsoleIO.WriteLine($"Minecraft Console Client v{Version} - for MC {MCLowestVersion} to {MCHighestVersion} - Github.com/MCCTeam");
|
||||
if (BuildInfo is not null)
|
||||
ConsoleIO.WriteLineFormatted("§8" + BuildInfo);
|
||||
if (Config.Console.General.Display_Icon_Banner && ConsoleIO.Backend is Tui.TuiConsoleBackend tuiBanner)
|
||||
{
|
||||
var view = tuiBanner.GetView();
|
||||
if (view is not null)
|
||||
{
|
||||
Avalonia.Threading.Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
var panel = Tui.MccBannerPanelBuilder.Build(BuildInfo);
|
||||
view.AppendControlToLog(panel);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowClassicBanner();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowClassicBanner();
|
||||
}
|
||||
|
||||
var cfg = state.ConfigResult;
|
||||
|
||||
|
|
@ -271,6 +288,13 @@ namespace MinecraftClient
|
|||
return true;
|
||||
}
|
||||
|
||||
private static void ShowClassicBanner()
|
||||
{
|
||||
ConsoleIO.WriteLine(string.Format(Translations.mcc_banner_classic, Version, MCLowestVersion, MCHighestVersion, "Github.com/MCCTeam"));
|
||||
if (BuildInfo is not null)
|
||||
ConsoleIO.WriteLineFormatted("§8" + BuildInfo);
|
||||
}
|
||||
|
||||
private static void MaybePrintClassicModeTuiRecommendation()
|
||||
{
|
||||
if (ConsoleIO.BasicIO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue