parser errors are updated and now loading failed return to main menu

This commit is contained in:
Clément Le Bihan
2021-06-18 17:30:32 +02:00
parent a359ede5d6
commit 09d73c7988
2 changed files with 24 additions and 24 deletions
+4 -4
View File
@@ -77,13 +77,13 @@ namespace BBM
ParserYAML::load(gameScene);
} catch (std::exception const &err) {
std::cout << err.what() << std::endl;
Runner::gameState._loadedScenes[GameState::SceneID::LobbyScene]->addEntity("Error message parser")
Runner::gameState._loadedScenes[GameState::SceneID::MainMenuScene]->addEntity("Error message parser")
.addComponent<PositionComponent>(1920 / 5, 2 * 1080 / 4.25, 0)
.addComponent<TimerComponent>(3s, [](WAL::Entity &myEntity, WAL::Wal &wal) {
.addComponent<TimerComponent>(3s, [](WAL::Entity &myEntity, WAL::Wal &) {
myEntity.scheduleDeletion();
})
.addComponent<Drawable2DComponent, RAY2D::Text>(err.what(), 50, RAY::Vector2(), RED);
gameState.nextScene = BBM::GameState::SceneID::LobbyScene;
.addComponent<Drawable2DComponent, RAY2D::Text>("Could not load file: " + std::string(err.what()), 50, RAY::Vector2(), RED);
gameState.nextScene = BBM::GameState::SceneID::MainMenuScene;
return;
}
Runner::gameState._loadedScenes[GameState::SceneID::GameScene] = gameScene;