yuanshen/Yuanshen.Common/Console/ConsoleBanner.cs
wisedev fc2ac1050f First working version of the server
KCP gameserver with packet dispatch, scene streaming, combat, gacha and the
shop, plus a small HTTP server for the login flow and the wish history page.

Game data under assets is pulled out of the client instead of being typed by
hand. The excel tables come from the packed bin container and the spawn points
from the compiled scene scripts.
2026-09-04 02:10:50 +03:00

53 lines
2.7 KiB
C#

using Pastel;
namespace Yuanshen.Common.Console;
public static class ConsoleBanner
{
private static readonly string[] Art =
{
@"██╗ ██╗██╗ ██╗ █████╗ ███╗ ██╗███████╗██╗ ██╗███████╗███╗ ██╗",
@"╚██╗ ██╔╝██║ ██║██╔══██╗████╗ ██║██╔════╝██║ ██║██╔════╝████╗ ██║",
@" ╚████╔╝ ██║ ██║███████║██╔██╗ ██║███████╗███████║█████╗ ██╔██╗ ██║",
@" ╚██╔╝ ██║ ██║██╔══██║██║╚██╗██║╚════██║██╔══██║██╔══╝ ██║╚██╗██║",
@" ██║ ╚██████╔╝██║ ██║██║ ╚████║███████║██║ ██║███████╗██║ ╚████║",
@" ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝"
};
private const int RuleWidth = 70;
public static void Print(string title, IReadOnlyList<(string Key, string Value)> rows)
{
ConsoleTheme.Enable();
System.Console.WriteLine();
for (int i = 0; i < Art.Length; i++)
{
double t = (double)i / Math.Max(Art.Length - 1, 1);
string rendered = ConsoleTheme.Gradient(
Art[i],
ConsoleTheme.Lerp(ConsoleTheme.GradientFrom, ConsoleTheme.GradientTo, t * 0.5),
ConsoleTheme.Lerp(ConsoleTheme.GradientFrom, ConsoleTheme.GradientTo, 0.5 + t * 0.5));
System.Console.WriteLine(ConsoleTheme.Center(Art[i], rendered));
}
System.Console.WriteLine();
System.Console.WriteLine(ConsoleTheme.Center(title, ConsoleTheme.Gradient(title)));
System.Console.WriteLine();
string rule = new('─', RuleWidth);
System.Console.WriteLine(ConsoleTheme.Center(rule, rule.Pastel(ConsoleTheme.Muted)));
foreach ((string key, string value) in rows)
{
string plain = $"{key,-14}{value}";
string rendered = $"{key,-14}".Pastel(ConsoleTheme.Accent) + value.Pastel(ConsoleTheme.Text);
System.Console.WriteLine(ConsoleTheme.Center(plain, rendered));
}
System.Console.WriteLine(ConsoleTheme.Center(rule, rule.Pastel(ConsoleTheme.Muted)));
System.Console.WriteLine();
}
}