diff --git a/sources/Runner/PauseMenuScene.cpp b/sources/Runner/PauseMenuScene.cpp index 294dd860..48de8f3f 100644 --- a/sources/Runner/PauseMenuScene.cpp +++ b/sources/Runner/PauseMenuScene.cpp @@ -54,25 +54,25 @@ namespace BBM gameState.nextScene = BBM::GameState::SceneID::GameScene; }); auto &save = scene->addEntity("save & quit button") - .addComponent(1920 / 2.5, 1080 - 240, 0) - .addComponent("assets/buttons/button_save.png") - .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + .addComponent(1920 / 2.5, 1080 - 240, 0) + .addComponent("assets/buttons/button_save.png") + .addComponent([](WAL::Entity &entity, WAL::Wal &) + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_save.png"); - }) - .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + texture->use("assets/buttons/button_save.png"); + }) + .addComponent([](WAL::Entity &entity, WAL::Wal &) + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_save_hovered.png"); - }) - .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - ParserYAML::save(Runner::gameState._loadedScenes[GameState::SceneID::GameScene]); - gameState.nextScene = BBM::GameState::SceneID::MainMenuScene; - }); + texture->use("assets/buttons/button_save_hovered.png"); + }) + .addComponent([](WAL::Entity &entity, WAL::Wal &) + { + ParserYAML::save(Runner::gameState._loadedScenes[GameState::SceneID::GameScene]); + gameState.nextScene = BBM::GameState::SceneID::MainMenuScene; + }); auto &settings = scene->addEntity("settings button") .addComponent(1920 / 2.5, 1080 - 360, 0) .addComponent("assets/buttons/button_settings.png") diff --git a/sources/Runner/ResumeLobbyScene.cpp b/sources/Runner/ResumeLobbyScene.cpp index 763ad58f..2d22d5fb 100644 --- a/sources/Runner/ResumeLobbyScene.cpp +++ b/sources/Runner/ResumeLobbyScene.cpp @@ -49,22 +49,22 @@ namespace BBM .addComponent(1920 / 2.5, 1080 - 180, 0) .addComponent("assets/buttons/button_new_game.png") .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - auto *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_new_game.png"); - }) + { + auto *texture = dynamic_cast(entity.getComponent().drawable.get()); + texture->use("assets/buttons/button_new_game.png"); + }) .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - auto *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_new_game_hovered.png"); - }) + { + auto *texture = dynamic_cast(entity.getComponent().drawable.get()); + texture->use("assets/buttons/button_new_game_hovered.png"); + }) .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - if (Runner::gameState.currentScene != GameState::ResumeLobbyScene - || !LobbySystem::playersAreReady(*wal.getScene())) - return; - LobbySystem::resumeToGame(wal); - }) + { + if (Runner::gameState.currentScene != GameState::ResumeLobbyScene + || !LobbySystem::playersAreReady(*wal.getScene())) + return; + LobbySystem::resumeToGame(wal); + }) .addComponent>(); auto &back = scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) @@ -74,11 +74,10 @@ namespace BBM gameState.nextScene = BBM::GameState::SceneID::MainMenuScene; }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - - texture->use("assets/buttons/button_back.png"); - }) + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + texture->use("assets/buttons/button_back.png"); + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) { RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); @@ -86,8 +85,8 @@ namespace BBM texture->use("assets/buttons/button_back_hovered.png"); }); scene->addEntity("camera") - .addComponent(8, 20, 7) - .addComponent(Vector3f(8, 0, 8)); + .addComponent(8, 20, 7) + .addComponent(Vector3f(8, 0, 8)); play.getComponent().setButtonLinks(nullptr, &back, &back, nullptr); back.getComponent().setButtonLinks(&play, nullptr, nullptr, &play); return scene;