This commit is contained in:
2026-08-11 21:00:46 +02:00
parent 9c65dafdcf
commit 12586262cb
+19 -26
View File
@@ -133,7 +133,7 @@ namespace MarcerGameDvdLauncher
_cachedBuffer[i].Text = null!; _cachedBuffer[i].Text = null!;
} }
// Renders a centered, bordered help box with key bindings inside the // Renders a centered help box with key bindings inside the
// available console area. The caller is responsible for waiting on a // available console area. The caller is responsible for waiting on a
// key and redrawing the menu afterward. // key and redrawing the menu afterward.
public void ShowHelpBox(int availableLines) public void ShowHelpBox(int availableLines)
@@ -147,26 +147,18 @@ namespace MarcerGameDvdLauncher
Console.BackgroundColor = ConsoleColor.DarkGray; Console.BackgroundColor = ConsoleColor.DarkGray;
Console.ForegroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.White;
var topBorder = "+" + new string('-', Math.Max(0, boxWidth - 2)) + "+"; // Fill the box area without borders for cleaner appearance
Console.SetCursorPosition(0, topRow); for (var i = 0; i < boxHeight; i++)
Console.Write(topBorder);
for (var i = 0; i < boxHeight - 2; i++)
{ {
var row = topRow + 1 + i; var row = topRow + i;
var content = i < helpLines.Length if (row < Console.WindowHeight)
? PadToWidth(helpLines[i], boxWidth - 2) {
: new string(' ', Math.Max(0, boxWidth - 2)); Console.SetCursorPosition(0, row);
Console.SetCursorPosition(0, row); var content = i == 0 || i == boxHeight - 1 || i >= helpLines.Length + 2
Console.Write("|" + content + "|"); ? new string(' ', boxWidth)
} : PadToWidth(helpLines[i - 1], boxWidth);
Console.Write(content);
var bottomRow = topRow + boxHeight - 1; }
if (bottomRow < Console.WindowHeight)
{
var bottomBorder = "+" + new string('-', Math.Max(0, boxWidth - 2)) + "+";
Console.SetCursorPosition(0, bottomRow);
Console.Write(bottomBorder);
} }
Console.ResetColor(); Console.ResetColor();
} }
@@ -178,12 +170,13 @@ namespace MarcerGameDvdLauncher
" ", " ",
" ↑ / ↓ Move selection up / down", " ↑ / ↓ Move selection up / down",
" Enter / → Open folder / launch ZIP with Hatari", " Enter / → Open folder / launch ZIP with Hatari",
" ← / BS Go up one directory (never exceeds root)", " ← / Backspace Go up one directory (never exceeds root)",
" ESC / Q Exit the program", " ESC Exit the program",
" PgUp Jump one page up", " q Exit the program (alternative)",
" PgDn Jump one page down", " PgUp Jump one page up",
" * Toggle favorite on selected ZIP", " PgDn Jump one page down",
" ? Show this help", " * Toggle favorite on selected ZIP",
" ? Show this help",
" ", " ",
" Navigation is strictly limited to RootDirectory.", " Navigation is strictly limited to RootDirectory.",
" The overlay shows both root and patch layers combined.", " The overlay shows both root and patch layers combined.",