- Added support for NTLDR style freeloader GUI. To enable, edit freeldr.ini and add:
[reactos.git] / reactos / boot / freeldr / freeldr / ui / ui.c
index 93ccd69..299f817 100644 (file)
@@ -50,6 +50,11 @@ BOOL UserInterfaceUp                         = FALSE;                                // Tells us if the user interface is display
 VIDEODISPLAYMODE       UiDisplayMode           = VideoTextMode;                // Tells us if we are in text or graphics mode
 
 BOOL   UiUseSpecialEffects                     = FALSE;                                // Tells us if we should use fade effects
+BOOL   UiDrawTime                                      = TRUE;                                 // Tells us if we should draw the time
+BOOL   UiMinimal                                       = FALSE;                                // Tells us if we should use a minimal console-like UI
+BOOL   UiCenterMenu                            = TRUE;                                 // Tells us if we should use a centered or left-aligned menu
+BOOL   UiMenuBox                                       = TRUE;                                 // Tells us if we shuld draw a box around the menu
+CHAR   UiTimeText[260] = "[Time Remaining: ] ";
 
 const CHAR     UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
 
@@ -87,6 +92,10 @@ BOOL UiInitialize(BOOLEAN ShowGui)
                {
                        strcpy(UiTitleBoxTitleText, SettingText);
                }
+               if (IniReadSettingByName(SectionId, "TimeText", SettingText, 260))
+               {
+                       strcpy(UiTimeText, SettingText);
+               }
                if (IniReadSettingByName(SectionId, "StatusBarColor", SettingText, 260))
                {
                        UiStatusBarBgColor = UiTextToColor(SettingText);
@@ -162,6 +171,50 @@ BOOL UiInitialize(BOOLEAN ShowGui)
                                UiUseSpecialEffects = FALSE;
                        }
                }
+               if (IniReadSettingByName(SectionId, "ShowTime", SettingText, 260))
+               {
+                       if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+                       {
+                               UiDrawTime = TRUE;
+                       }
+                       else
+                       {
+                               UiDrawTime = FALSE;
+                       }
+               }
+               if (IniReadSettingByName(SectionId, "MinimalUI", SettingText, 260))
+               {
+                       if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+                       {
+                               UiMinimal = TRUE;
+                       }
+                       else
+                       {
+                               UiMinimal = FALSE;
+                       }
+               }
+               if (IniReadSettingByName(SectionId, "MenuBox", SettingText, 260))
+               {
+                       if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+                       {
+                               UiMenuBox = TRUE;
+                       }
+                       else
+                       {
+                               UiMenuBox = FALSE;
+                       }
+               }
+               if (IniReadSettingByName(SectionId, "CenterMenu", SettingText, 260))
+               {
+                       if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+                       {
+                               UiCenterMenu = TRUE;
+                       }
+                       else
+                       {
+                               UiCenterMenu = FALSE;
+                       }
+               }
        }
 
        UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE);