XTLDR Rewrite #7

Merged
belliash merged 184 commits from xtldr_rewrite into master 2024-01-09 18:51:04 +01:00
Showing only changes of commit 0c5f2d18b6 - Show all commits

View File

@ -1063,8 +1063,7 @@ BlDisplayBootMenu()
EfiSystemTable->BootServices->SetTimer(TimerEvent, TimerCancel, 0);
/* Remove the timer message */
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L" ", TimeOut);
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
}
/* Read key stroke */
@ -1073,6 +1072,12 @@ BlDisplayBootMenu()
if(Key.ScanCode == 0x03 || Key.UnicodeChar == 0x0D)
{
/* ENTER or RightArrow key pressed, boot the highlighted OS */
BlSetConsoleAttributes(Handle.DialogColor | Handle.TextColor);
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"Booting '%S' now...", MenuEntries[HighligtedEntryId].EntryName);
/* Boot the highlighted (chosen) OS */
BlDisplayInfoDialog(L"XTLDR", L"Booting highlighted OS ...");
/* Break from boot menu event loop to redraw whole boot menu */
@ -1150,16 +1155,17 @@ BlDisplayBootMenu()
if(TimeOut > 0)
{
/* Update a message and decrease timeout value */
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"The highlighted position will be booted automatically in %ld seconds. ", TimeOut);
BlConsolePrint(L"The highlighted position will be booted automatically in %ld seconds.", TimeOut);
TimeOut--;
}
else if(TimeOut == 0)
{
/* Time out expired, update a message */
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"Booting '%S' now... ",
MenuEntries[HighligtedEntryId].EntryName);
BlConsolePrint(L"Booting '%S' now...", MenuEntries[HighligtedEntryId].EntryName);
/* Disable the timer just in case booting OS fails */
TimeOut = -1;