Added custom window positioning, sizing, and added configuration file loading before the game window is constructed .

This commit is contained in:
2024-02-19 22:38:42 -06:00
parent 92f488986e
commit bf33ad79c9
10 changed files with 54 additions and 36 deletions
+5 -2
View File
@@ -115,9 +115,12 @@ void Menu::InitializeSettingsWindow(){
settingsWindow->ADD("Keyboard Play Auto-Aim Label",MenuLabel)(geom2d::rect<float>{{windowSize.x/2+22.f,104},{windowSize.x/2-24.f,16.f}},"Aim Assist\n(No Mouse Players)",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END;
#ifndef __EMSCRIPTEN__
settingsWindow->ADD("Fullscreen Toggle Checkbox",Checkbox)(geom2d::rect<float>{{windowSize.x/2+4.f,124},{16.f,16.f}},[](ToggleFuncData data){
game->SetFullscreen(data.checked,{});
if(data.checked){ //When going to fullscreen mode, the windowed mode positioning needs to be saved to be restored later.
GameSettings::SetWindowPos(game->GetActualWindowPos());
}
game->SetFullscreen(data.checked,GameSettings::GetWindowPos());
return true;
},false)END;
},game->IsFullscreen())END;
settingsWindow->ADD("Fullscreen Toggle Label",MenuLabel)(geom2d::rect<float>{{windowSize.x/2+22.f,124},{windowSize.x/2-24.f,16.f}},"Fullscreen",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END;
#endif