Implemented User ID screen, added a text change callback function for text entry labels.

This commit is contained in:
2024-01-03 04:59:47 -06:00
parent 6dc88f0d1f
commit 57f0b84dff
8 changed files with 54 additions and 14 deletions
+3 -1
View File
@@ -47,8 +47,9 @@ using A=Attribute;
void Menu::InitializeMainMenuWindow(){
Menu*mainMenuWindow=CreateMenu(MAIN_MENU,CENTERED,vi2d{96,96});
mainMenuWindow->ADD("New Game Button",MenuComponent)({{12,4},{72,24}},"New Game",[](MenuFuncData data){
mainMenuWindow->ADD("New Game Button",MenuComponent)({{12,4},{72,24}},"New Game",[&](MenuFuncData data){
#ifdef __EMSCRIPTEN__
data.menu.S(A::NEXT_MENU)="New Game";
if(SaveFile::GetUserID().length()==0){
game->TextEntryEnable(true);
Menu::OpenMenu(USER_ID);
@@ -63,6 +64,7 @@ void Menu::InitializeMainMenuWindow(){
mainMenuWindow->ADD("Load Game Button",MenuComponent)({{12,36},{72,24}},"Load Game",[](MenuFuncData data){
SaveFile::UpdateSaveGameData();
#ifdef __EMSCRIPTEN__
data.menu.S(A::NEXT_MENU)="Load Game";
if(SaveFile::GetUserID().length()==0){
game->TextEntryEnable(true);
Menu::OpenMenu(USER_ID);