- // We always draw the top level menu...
- if (GUIState == GUI_TOP_MENU)
- menuChosen = -1;
-
- uint32 xpos = 0;
- for(uint32 i=0; i<NUM_MENU_ITEMS; i++)
- {
- uint16 colorFG = 0x1CFF, colorBG = 0x000F;
- uint32 length = strlen(menu[i]) + 2;
-
- if (((uint32)mouseX >= xpos && (uint32)mouseX < xpos + length * 8)
- && mouseY < 8)
- colorFG = 0x421F, colorBG = 0x1CFF, menuChosen = i, menuXPos = xpos;
-
- if (GUIState != GUI_TOP_MENU && i == (uint32)menuChosen)
- colorFG = 0x421F, colorBG = 0x1CFF;
-// BG: 0 00011 00011 11111 -> 0000 1100 0111 1111
-// FG: 0 10000 10000 11111 -> 0100 0010 0001 1111
- DrawStringOpaque(backbuffer, xpos, 0, colorFG, colorBG, " %s ", menu[i]);
- xpos += length * 8;
- }
-
- // We don't always draw the submenus...
- if (GUIState == GUI_MENU_CLICKED)
- {
- menuItemChosen = -1;
- uint32 length = 0;
- for(int i=0; i<subMenuNumItems[menuChosen]; i++)
- if (strlen(subMenu[menuChosen][i]) > length)
- length = strlen(subMenu[menuChosen][i]);
-
- uint32 ypos = 9;
- for(int i=0; i<subMenuNumItems[menuChosen]; i++)
- {
- uint16 colorFG = 0x1CFF, colorBG = 0x000F;
-
- if (((uint32)mouseX >= menuXPos && (uint32)mouseX < menuXPos + (length + 2) * 8)
- && mouseY >= (9 + i * 8) && mouseY < (9 + (i + 1) * 8))
- colorFG = 0x421F, colorBG = 0x1CFF, menuItemChosen = i;
-
- DrawStringOpaque(backbuffer, menuXPos, ypos, colorFG, colorBG, " %-*.*s ", length, length, subMenu[menuChosen][i]);
- ypos += 8;
- }
- }
- // Windows? Isn't that an illegal monopoly or something? ;-)
- else if (GUIState == GUI_WINDOW)
- {
- }
-