mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add test.close_world(bool)
This commit is contained in:
parent
9b4dd8f65e
commit
d3f74b56fa
8 changed files with 30 additions and 11 deletions
|
|
@ -16,7 +16,14 @@ void Mainloop::run() {
|
|||
auto& time = engine.getTime();
|
||||
|
||||
engine.setLevelConsumer([this](auto level) {
|
||||
engine.setScreen(std::make_shared<LevelScreen>(&engine, std::move(level)));
|
||||
if (level == nullptr) {
|
||||
// destroy LevelScreen and run quit callbacks
|
||||
engine.setScreen(nullptr);
|
||||
// create and go to menu screen
|
||||
engine.setScreen(std::make_shared<MenuScreen>(&engine));
|
||||
} else {
|
||||
engine.setScreen(std::make_shared<LevelScreen>(&engine, std::move(level)));
|
||||
}
|
||||
});
|
||||
|
||||
logger.info() << "starting menu screen";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue