From c518de097acdad9689a0aef36f5408788d118428 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 20 Jun 2021 12:14:10 +0200 Subject: [PATCH 1/7] Fixing pause menu without control --- sources/Runner/GameScene.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sources/Runner/GameScene.cpp b/sources/Runner/GameScene.cpp index 46f4e76b..a9103241 100644 --- a/sources/Runner/GameScene.cpp +++ b/sources/Runner/GameScene.cpp @@ -3,9 +3,7 @@ #include "Runner.hpp" #include #include "Component/Tag/TagComponent.hpp" -#include #include -#include #include "Component/Music/MusicComponent.hpp" #include "Component/Sound/SoundComponent.hpp" #include "Component/Controllable/ControllableComponent.hpp" @@ -18,7 +16,6 @@ #include "Component/Collision/CollisionComponent.hpp" #include "Component/Movable/MovableComponent.hpp" #include "Component/BombHolder/BombHolderComponent.hpp" -#include "Component/Tag/TagComponent.hpp" #include "Component/Renderer/Drawable3DComponent.hpp" #include "Component/Shaders/Items/AlphaCtxShaderComponent.hpp" #include "Component/Speed/SpeedComponent.hpp" @@ -26,7 +23,6 @@ #include "Component/Shaders/ShaderComponent.hpp" #include "Component/Gravity/GravityComponent.hpp" #include "Component/BumperTimer/BumperTimerComponent.hpp" -#include "Component/Timer/TimerComponent.hpp" #include "Model/Model.hpp" #include "Map/Map.hpp" #include "Component/Score/ScoreComponent.hpp" @@ -48,6 +44,7 @@ namespace BBM scene->addEntity("background image") .addComponent("assets/map/breakable_wall.obj", true, std::make_pair(MAP_DIFFUSE, "assets/backgrounds/gameWall.png"), Vector3f(50, 1, 50), -90, Vector3f(), Vector3f(1, 0, 0)) .addComponent(5, 14, 22); + addMenuControl(*scene); return scene; } From de6bdf61fe5b8bf5454f835df72ccfbbdfb671f2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 20 Jun 2021 12:17:43 +0200 Subject: [PATCH 2/7] Fixing the pause timer --- sources/Runner/GameScene.cpp | 1 + sources/Runner/PauseMenuScene.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sources/Runner/GameScene.cpp b/sources/Runner/GameScene.cpp index a9103241..eb154824 100644 --- a/sources/Runner/GameScene.cpp +++ b/sources/Runner/GameScene.cpp @@ -126,6 +126,7 @@ namespace BBM if (!ent.hasComponent()) return; ent.removeComponent(); + ent.removeComponent(); ent.removeComponent(); ent.removeComponent(); }); diff --git a/sources/Runner/PauseMenuScene.cpp b/sources/Runner/PauseMenuScene.cpp index 7a6d2aa9..6509b3f9 100644 --- a/sources/Runner/PauseMenuScene.cpp +++ b/sources/Runner/PauseMenuScene.cpp @@ -1,5 +1,4 @@ -#include #include #include "Runner.hpp" #include @@ -59,6 +58,10 @@ namespace BBM .addComponent([](WAL::Entity &, WAL::Wal &) { auto &gameScene = gameState.loadedScenes[BBM::GameState::SceneID::GameScene]; + + for (WAL::Entity &entity : gameScene->view>()) + entity.scheduleDeletion(); + for (auto &[entity, controller, _] : gameScene->view()) { controller.disabled = true; controller.pause = false; @@ -78,6 +81,7 @@ namespace BBM }) .addComponent(1920 / 2 - 2 * 30, 1080 / 2, 0) .addComponent>() + .addComponent>() .addComponent("", 60, RAY::Vector2(), ORANGE); gameState.nextScene = BBM::GameState::SceneID::GameScene; }); @@ -86,17 +90,17 @@ namespace BBM .addComponent("assets/buttons/button_save.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + auto *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()); + auto *texture = dynamic_cast(entity.getComponent().drawable.get()); texture->use("assets/buttons/button_save_hovered.png"); }) - .addComponent([](WAL::Entity &entity, WAL::Wal &wal) + .addComponent([](WAL::Entity &, WAL::Wal &wal) { if (!std::filesystem::exists("save")) std::filesystem::create_directories("save"); From e397a5898ac8862116071f6303d6e62f32a56cf4 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 20 Jun 2021 12:20:13 +0200 Subject: [PATCH 3/7] Fixing score on draw --- sources/Runner/ScoreScene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/Runner/ScoreScene.cpp b/sources/Runner/ScoreScene.cpp index 53416e07..e6a4a021 100644 --- a/sources/Runner/ScoreScene.cpp +++ b/sources/Runner/ScoreScene.cpp @@ -91,7 +91,7 @@ namespace BBM tilesColor[place]); scene->addEntity("player") .addComponent(224 * (i + 1) + 200 * i, 1080 / 2.5, 0) - .addComponent(playersIconPath[place]); + .addComponent(playersIconPath[i]); } auto &play = scene->addEntity("play button") .addComponent(1920 / 2.5, 1080 - 180, 0) From cddeeaf3f9031219e205efb4ed6dc8d34293d248 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 20 Jun 2021 12:32:42 +0200 Subject: [PATCH 4/7] Fixing #255 --- sources/Runner/LobbyScene.cpp | 1 - sources/System/Lobby/LobbySystem.cpp | 40 +++++++++++-------- sources/System/Lobby/LobbySystem.hpp | 4 +- .../MenuControllableSystem.cpp | 37 ++++++++--------- .../MenuControllableSystem.hpp | 6 +-- 5 files changed, 49 insertions(+), 39 deletions(-) diff --git a/sources/Runner/LobbyScene.cpp b/sources/Runner/LobbyScene.cpp index 92f54565..6eb8d88b 100644 --- a/sources/Runner/LobbyScene.cpp +++ b/sources/Runner/LobbyScene.cpp @@ -186,7 +186,6 @@ namespace BBM .addComponent("assets/player/icons/none.png"); auto &ready = scene->addEntity("ready") .addComponent(224 * (i + 1) + 200 * i, 1080 / 3 - 50, 0) - // todo check why it does this | hacky way to fix ready texture .addComponent(); player.addComponent(i, ready, playerTile); } diff --git a/sources/System/Lobby/LobbySystem.cpp b/sources/System/Lobby/LobbySystem.cpp index 0a10d8ae..2bd34e1a 100644 --- a/sources/System/Lobby/LobbySystem.cpp +++ b/sources/System/Lobby/LobbySystem.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "Component/Color/ColorComponent.hpp" #include "Component/Stat/StatComponent.hpp" @@ -66,7 +65,7 @@ namespace BBM lobby.coloredTile.getComponent().drawable->setColor(_rayColors[lobby.color]); } - void LobbySystem::onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds dtime) + void LobbySystem::onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds) { auto &lobby = entity.get(); @@ -77,7 +76,7 @@ namespace BBM if (lobby.layout == ControllableComponent::NONE) { for (auto &[_, ctrl] : this->_wal.getScene()->view()) { auto &controller = ctrl; - if (controller.bomb) { + if (controller.bomb && this->_canJoin()) { if (std::any_of(this->getView().begin(), this->getView().end(), [&controller](WAL::ViewEntity &view) { return view.get().layout == controller.layout; })) @@ -95,7 +94,7 @@ namespace BBM for (auto &[_, controller] : this->_wal.getScene()->view()) { if (controller.layout != lobby.layout) continue; - if (controller.bomb && !lobby.ready) { + if (controller.bomb && !lobby.ready && this->_canJoin()) { lobby.ready = true; lobby.lastInput = lastTick; controller.bomb = false; @@ -104,13 +103,22 @@ namespace BBM if (texture) texture->use("assets/player/icons/ready.png"); } - if (controller.secondary && !lobby.ready) { + if (controller.secondary) { lobby.lastInput = lastTick; this->_nextColor(entity); } } } + bool LobbySystem::_canJoin() + { + auto *button = this->_wal.getSystem().currentButton; + + if (!button) + return true; + return button->hasComponent>(); + } + void LobbySystem::addAI() { for (auto entity : this->getView()) { @@ -152,7 +160,7 @@ namespace BBM texture->unload(); } - void LobbySystem::onSelfUpdate(std::chrono::nanoseconds dtime) + void LobbySystem::onSelfUpdate(std::chrono::nanoseconds) { auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); if (view.size() == 0) @@ -209,7 +217,7 @@ namespace BBM player.getComponent().layout = layout; } - void LobbySystem::createTile(std::shared_ptr scene, WAL::Entity &player, int color, int playerCount) + void LobbySystem::createTile(const std::shared_ptr& scene, WAL::Entity &player, int color, int playerCount) { std::string texturePath = "assets/player/ui/" + colors[color] + ".png"; int x = (playerCount % 2 == 0) ? 1920 - 10 - 320 : 10; @@ -223,25 +231,25 @@ namespace BBM scene->addEntity("player hide fireup") .addComponent(x + 220, y + 35, 0) .addComponent("", 20, x, y, WHITE) - .addComponent([&player](Drawable2DComponent &drawble) { + .addComponent([&player](Drawable2DComponent &drawable) { const BombHolderComponent *bonus = player.tryGetComponent(); if (!bonus) return; - RAY2D::Text *text = dynamic_cast(drawble.drawable.get()); + auto *text = dynamic_cast(drawable.drawable.get()); if (!text) return; text->setText(std::to_string(static_cast(bonus->explosionRadius))); }); - scene->addEntity("player hide bombup") + scene->addEntity("player hide bomb-up") .addComponent(x + 220, y + 77, 0) .addComponent("", 20, x, y, WHITE) - .addComponent([&player](Drawable2DComponent &drawble) { + .addComponent([&player](Drawable2DComponent &drawable) { const BombHolderComponent *bonus = player.tryGetComponent(); if (!bonus) return; - RAY2D::Text *text = dynamic_cast(drawble.drawable.get()); + auto *text = dynamic_cast(drawable.drawable.get()); if (!text) return; text->setText(std::to_string(bonus->bombCount) + " / " + std::to_string(bonus->maxBombCount)); @@ -249,12 +257,12 @@ namespace BBM scene->addEntity("player hide speedup") .addComponent(x + 220, y + 122, 0) .addComponent("", 20, x, y, WHITE) - .addComponent([&player](Drawable2DComponent &drawble) { + .addComponent([&player](Drawable2DComponent &drawable) { auto *speed = player.tryGetComponent(); if (!speed) return; - RAY2D::Text *text = dynamic_cast(drawble.drawable.get()); + auto *text = dynamic_cast(drawable.drawable.get()); if (!text) return; text->setText(std::to_string(static_cast(speed->speed * 100))); @@ -262,12 +270,12 @@ namespace BBM scene->addEntity("player hide wall") .addComponent(x + 220, y + 161, 0) .addComponent("", 20, x, y, WHITE) - .addComponent([&player](Drawable2DComponent &drawble) { + .addComponent([&player](Drawable2DComponent &drawable) { const PlayerBonusComponent *bonus = player.tryGetComponent(); if (!bonus) return; - RAY2D::Text *text = dynamic_cast(drawble.drawable.get()); + auto *text = dynamic_cast(drawable.drawable.get()); if (!text) return; text->setText(bonus->isNoClipOn ? "YES" : "NO"); diff --git a/sources/System/Lobby/LobbySystem.hpp b/sources/System/Lobby/LobbySystem.hpp index 67878d85..4e4e7aaa 100644 --- a/sources/System/Lobby/LobbySystem.hpp +++ b/sources/System/Lobby/LobbySystem.hpp @@ -18,6 +18,8 @@ namespace BBM { private: + bool _canJoin(); + void _nextColor(WAL::ViewEntity &entity); @@ -31,7 +33,7 @@ namespace BBM static void addController(WAL::Entity &player, ControllableComponent::Layout layout); //! @brief Create ingame tile - static void createTile(std::shared_ptr scene, WAL::Entity &player, int color, int playerCount); + static void createTile(const std::shared_ptr& drawable, WAL::Entity &player, int color, int playerCount); //! @inherit void onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds dtime) override; diff --git a/sources/System/MenuControllable/MenuControllableSystem.cpp b/sources/System/MenuControllable/MenuControllableSystem.cpp index 766d575d..919786ea 100644 --- a/sources/System/MenuControllable/MenuControllableSystem.cpp +++ b/sources/System/MenuControllable/MenuControllableSystem.cpp @@ -18,13 +18,14 @@ namespace BBM { MenuControllableSystem::MenuControllableSystem(WAL::Wal &wal) : System(wal), - _currentButton(), _oldMousePosition(-1, -1) + _oldMousePosition(-1, -1), + currentButton() { } void MenuControllableSystem::_updateCurrentButton(bool selected, Vector2f move) { - auto &buttonComponent = this->_currentButton->getComponent(); + auto &buttonComponent = this->currentButton->getComponent(); WAL::Entity *newButton = nullptr; if (move.y > 0 && buttonComponent._up) @@ -44,12 +45,12 @@ namespace BBM } if (newButton) { - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); - this->_currentButton = newButton; - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); + this->currentButton = newButton; + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); } if (selected) - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); } bool MenuControllableSystem::_mouseOnButton(const Vector2f &mousePos, WAL::ViewEntity &entity) const @@ -83,16 +84,16 @@ namespace BBM if (this->_oldMousePosition == Vector2f(-1, -1)) this->_oldMousePosition = relativeMousePos; - if (this->_currentButton && this->_currentButton->_scene.getID() != this->_wal.getScene()->getID()) { - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); - this->_currentButton = nullptr; + if (this->currentButton && this->currentButton->_scene.getID() != this->_wal.getScene()->getID()) { + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); + this->currentButton = nullptr; return; } - if (this->_currentButton == nullptr && buttons.size()) { - this->_currentButton = &(*buttons.front()); - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); + if (this->currentButton == nullptr && buttons.size()) { + this->currentButton = &(*buttons.front()); + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); } - if (!this->_currentButton) + if (!this->currentButton) return; for (auto &[_, controllable]: controllableView) if (controllable.move.x || controllable.move.y || controllable.bomb) { @@ -104,12 +105,12 @@ namespace BBM this->_oldMousePosition = relativeMousePos; for (auto &entity: buttons) { if (_mouseOnButton(relativeMousePos, entity)) { - if (this->_currentButton) - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); - this->_currentButton = &(*entity); - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); + if (this->currentButton) + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); + this->currentButton = &(*entity); + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); if (RAYControl::Mouse::isPressed(RAYControl::Mouse::Button::MOUSE_BUTTON_LEFT)) - this->_currentButton->getComponent().onEvent(*this->_currentButton, this->_wal); + this->currentButton->getComponent().onEvent(*this->currentButton, this->_wal); } } } diff --git a/sources/System/MenuControllable/MenuControllableSystem.hpp b/sources/System/MenuControllable/MenuControllableSystem.hpp index 28fe0a60..15d71099 100644 --- a/sources/System/MenuControllable/MenuControllableSystem.hpp +++ b/sources/System/MenuControllable/MenuControllableSystem.hpp @@ -17,9 +17,6 @@ namespace BBM class MenuControllableSystem : public WAL::System<> { private: - //! @brief index of the current button selected - WAL::Entity *_currentButton; - //! @brief position of the mouse at the precedent scene (to know which controller event to watch) Vector2f _oldMousePosition; @@ -30,6 +27,9 @@ namespace BBM //! @return true if mouse on entity bool _mouseOnButton(const Vector2f &mousePos, WAL::ViewEntity &entity) const; public: + //! @brief index of the current button selected + WAL::Entity *currentButton; + //! @brief time (in millisecond) since last check std::chrono::time_point now; //! @inherit From 4736d1790c322483c9bb8df6014c4aed177170cf Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 20 Jun 2021 12:36:25 +0200 Subject: [PATCH 5/7] Fixing play button color --- sources/Runner/ResumeLobbyScene.cpp | 4 +--- sources/System/Lobby/ResumeLobbySystem.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sources/Runner/ResumeLobbyScene.cpp b/sources/Runner/ResumeLobbyScene.cpp index c839e459..bc92fa47 100644 --- a/sources/Runner/ResumeLobbyScene.cpp +++ b/sources/Runner/ResumeLobbyScene.cpp @@ -17,9 +17,7 @@ #include #include #include -#include "System/Sound/PlayerSoundManagerSystem.hpp" #include "System/Music/MusicSystem.hpp" -#include "System/Lobby/LobbySystem.hpp" #include "Component/Lobby/LobbyComponent.hpp" namespace RAY3D = RAY::Drawables::Drawables3D; @@ -67,7 +65,7 @@ namespace BBM return; ResumeLobbySystem::resumeToGame(wal); }) - .addComponent>(); + .addComponent>(); auto &back = scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") diff --git a/sources/System/Lobby/ResumeLobbySystem.cpp b/sources/System/Lobby/ResumeLobbySystem.cpp index d1528bfc..5d57a25d 100644 --- a/sources/System/Lobby/ResumeLobbySystem.cpp +++ b/sources/System/Lobby/ResumeLobbySystem.cpp @@ -66,7 +66,7 @@ namespace BBM void ResumeLobbySystem::onSelfUpdate(std::chrono::nanoseconds dtime) { - auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); + auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); if (view.size() == 0) return; auto *texture = dynamic_cast(view.front().get().drawable.get()); From 4d1c16a233381d34f81de912c6ca85bc39a827dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sun, 20 Jun 2021 12:47:14 +0200 Subject: [PATCH 6/7] fixing tag component and rm unused includes --- sources/Component/Tag/TagComponent.hpp | 2 ++ sources/Runner/PauseMenuScene.cpp | 4 ++-- sources/Runner/ResumeLobbyScene.cpp | 2 +- sources/System/Lobby/ResumeLobbySystem.cpp | 10 +--------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sources/Component/Tag/TagComponent.hpp b/sources/Component/Tag/TagComponent.hpp index 5bcd837f..1c1f9883 100644 --- a/sources/Component/Tag/TagComponent.hpp +++ b/sources/Component/Tag/TagComponent.hpp @@ -62,4 +62,6 @@ namespace BBM // interact with bombs (getting damage etc) but doesn't stop explosion constexpr const char BlowablePass[] = "BlowablePass"; constexpr const char Timer[] = "Timer"; + constexpr const char RestartTimer[] = "RestartTimer"; + constexpr const char ResumeButton[] = "ResumeButton"; } diff --git a/sources/Runner/PauseMenuScene.cpp b/sources/Runner/PauseMenuScene.cpp index 6509b3f9..2999e5bb 100644 --- a/sources/Runner/PauseMenuScene.cpp +++ b/sources/Runner/PauseMenuScene.cpp @@ -59,7 +59,7 @@ namespace BBM { auto &gameScene = gameState.loadedScenes[BBM::GameState::SceneID::GameScene]; - for (WAL::Entity &entity : gameScene->view>()) + for (WAL::Entity &entity : gameScene->view>()) entity.scheduleDeletion(); for (auto &[entity, controller, _] : gameScene->view()) { @@ -81,7 +81,7 @@ namespace BBM }) .addComponent(1920 / 2 - 2 * 30, 1080 / 2, 0) .addComponent>() - .addComponent>() + .addComponent>() .addComponent("", 60, RAY::Vector2(), ORANGE); gameState.nextScene = BBM::GameState::SceneID::GameScene; }); diff --git a/sources/Runner/ResumeLobbyScene.cpp b/sources/Runner/ResumeLobbyScene.cpp index bc92fa47..8387d35b 100644 --- a/sources/Runner/ResumeLobbyScene.cpp +++ b/sources/Runner/ResumeLobbyScene.cpp @@ -65,7 +65,7 @@ namespace BBM return; ResumeLobbySystem::resumeToGame(wal); }) - .addComponent>(); + .addComponent>(); auto &back = scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") diff --git a/sources/System/Lobby/ResumeLobbySystem.cpp b/sources/System/Lobby/ResumeLobbySystem.cpp index 5d57a25d..9116b7a9 100644 --- a/sources/System/Lobby/ResumeLobbySystem.cpp +++ b/sources/System/Lobby/ResumeLobbySystem.cpp @@ -9,20 +9,12 @@ #include "Component/Speed/SpeedComponent.hpp" #include "System/MenuControllable/MenuControllableSystem.hpp" #include "Component/Tag/TagComponent.hpp" -#include #include -#include -#include -#include "Component/IAControllable/IAControllableComponent.hpp" #include #include -#include #include #include -#include #include "Component/Color/ColorComponent.hpp" -#include "Component/Stat/StatComponent.hpp" -#include "Component/Bonus/PlayerBonusComponent.hpp" #include "System/Lobby/LobbySystem.hpp" namespace RAY3D = RAY::Drawables::Drawables3D; @@ -66,7 +58,7 @@ namespace BBM void ResumeLobbySystem::onSelfUpdate(std::chrono::nanoseconds dtime) { - auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); + auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); if (view.size() == 0) return; auto *texture = dynamic_cast(view.front().get().drawable.get()); From 51d1e6e73b78e558eac96612941e940f70fe8dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sun, 20 Jun 2021 12:56:02 +0200 Subject: [PATCH 7/7] fixing last tag with quotes directly --- sources/Component/Tag/TagComponent.hpp | 1 + sources/Runner/LobbyScene.cpp | 2 +- sources/System/Lobby/LobbySystem.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sources/Component/Tag/TagComponent.hpp b/sources/Component/Tag/TagComponent.hpp index 1c1f9883..2a9e78ff 100644 --- a/sources/Component/Tag/TagComponent.hpp +++ b/sources/Component/Tag/TagComponent.hpp @@ -64,4 +64,5 @@ namespace BBM constexpr const char Timer[] = "Timer"; constexpr const char RestartTimer[] = "RestartTimer"; constexpr const char ResumeButton[] = "ResumeButton"; + constexpr const char PlayButton[] = "PlayButton"; } diff --git a/sources/Runner/LobbyScene.cpp b/sources/Runner/LobbyScene.cpp index 6eb8d88b..8fe3f129 100644 --- a/sources/Runner/LobbyScene.cpp +++ b/sources/Runner/LobbyScene.cpp @@ -77,7 +77,7 @@ namespace BBM return; LobbySystem::switchToGame(wal); }) - .addComponent>(); + .addComponent>(); auto &back = scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") diff --git a/sources/System/Lobby/LobbySystem.cpp b/sources/System/Lobby/LobbySystem.cpp index 2bd34e1a..ef888470 100644 --- a/sources/System/Lobby/LobbySystem.cpp +++ b/sources/System/Lobby/LobbySystem.cpp @@ -116,7 +116,7 @@ namespace BBM if (!button) return true; - return button->hasComponent>(); + return button->hasComponent>(); } void LobbySystem::addAI() @@ -162,7 +162,7 @@ namespace BBM void LobbySystem::onSelfUpdate(std::chrono::nanoseconds) { - auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); + auto &view = this->_wal.getScene()->view, Drawable2DComponent>(); if (view.size() == 0) return; auto *texture = dynamic_cast(view.front().get().drawable.get());