Implement main menu with text entry label. Update text entry mode in PGE, removed the ability to jump between saved commands and enter no longer clears or disables text entry by default.

This commit is contained in:
2024-01-01 01:59:41 -06:00
parent cbdd317068
commit dd2146ebda
18 changed files with 250 additions and 27 deletions
+10 -2
View File
@@ -38,11 +38,19 @@ All rights reserved.
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
#include "MenuLabel.h"
#include "MenuComponent.h"
INCLUDE_game
using A=Attribute;
void Menu::InitializeMainMenuWindow(){
Menu*mainMenuWindow=CreateMenu(MAIN_MENU,CENTERED,game->GetScreenSize()-vi2d{4,4});
Menu*mainMenuWindow=CreateMenu(MAIN_MENU,CENTERED,vi2d{96,96});
mainMenuWindow->ADD("New Game Button",MenuComponent)({{12,4},{72,24}},"New Game",[](MenuFuncData data){
game->TextEntryEnable(true);
Menu::OpenMenu(SAVE_FILE_NAME);
return true;
})END;
mainMenuWindow->ADD("Load Game Button",MenuComponent)({{12,36},{72,24}},"Load Game",DO_NOTHING)END;
mainMenuWindow->ADD("Quit Game Button",MenuComponent)({{12,68},{72,24}},"Quit Game",DO_NOTHING)END;
}