Fix file saving/loading for online mode.

This commit is contained in:
2024-01-27 04:51:14 -06:00
parent 7961e3d8aa
commit 39a710727e
8 changed files with 73 additions and 21 deletions
+9 -4
View File
@@ -44,9 +44,10 @@ void Menu::InitializeLoadGameWindow(){
Menu*loadGameWindow=CreateMenu(LOAD_GAME,CENTERED,vi2d{96,120});
loadGameWindow->ADD("Game Files Label",MenuLabel)(geom2d::rect<float>{{-8,-12},{112,12}},"Load Game",1.0f,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END;
loadGameWindow->ADD("Game Files List",ScrollableWindowComponent)(geom2d::rect<float>{{-8,4},{112,116}})END;
loadGameWindow->ADD("Online Game Files List",ScrollableWindowComponent)(geom2d::rect<float>{{-8,4},{112,116}})END
loadGameWindow->ADD("Game Files List",ScrollableWindowComponent)(geom2d::rect<float>{{-8,4},{112,116}})END
->Enable(false);
loadGameWindow->ADD("Online Game Files List",ScrollableWindowComponent)(geom2d::rect<float>{{-8,4},{112,116}})END
->Enable(true);
loadGameWindow->ADD("Go Back Button",MenuComponent)(geom2d::rect<float>{{24,124},{48,12}},"Back",[](MenuFuncData menu){Menu::CloseMenu();return true;})END;
@@ -64,8 +65,12 @@ void Menu::InitializeLoadGameWindow(){
#pragma region Keyboard Navigation Rules
loadGameWindow->SetupKeyboardNavigation(
[](MenuType type,Data&returnData){ //On Open
if(SaveFile::GetSaveFileCount()>0){
returnData=Component<ScrollableWindowComponent>(type,"Game Files List")->GetComponents()[0];
if(SaveFile::GetSaveFileCount()>0||SaveFile::GetOnlineSaveFileCount()>0){
if(SaveFile::IsOnline()){
returnData=Component<ScrollableWindowComponent>(type,"Online Game Files List")->GetComponents()[0];
}else{
returnData=Component<ScrollableWindowComponent>(type,"Game Files List")->GetComponents()[0];
}
}else{
returnData="Go Back Button";
}