This commit is contained in:
MihailRis
2024-03-22 11:35:55 +03:00
parent 9a817a86ff
commit b2abd57a71
4 changed files with 12 additions and 10 deletions
+8 -6
View File
@@ -181,11 +181,13 @@ void menus::create_pause_panel(Engine* engine, LevelController* controller) {
panel->add(guiutil::gotoButton(L"Settings", "settings", menu));
panel->add(create_button(L"Save and Quit to Menu", glm::vec4(10.f), glm::vec4(1), [=](GUI*){
// save world
controller->saveWorld();
// destroy LevelScreen and run quit callbacks
engine->setScreen(nullptr);
// create and go to menu screen
engine->setScreen(std::make_shared<MenuScreen>(engine));
engine->postRunnable([=]() {
// save world
controller->saveWorld();
// destroy LevelScreen and run quit callbacks
engine->setScreen(nullptr);
// create and go to menu screen
engine->setScreen(std::make_shared<MenuScreen>(engine));
});
}));
}