From 123fe91080381d93a586425624184c7bd2a2b42d Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 15 Jun 2021 14:03:07 +0200 Subject: [PATCH] Renaming the select button --- sources/Component/Controllable/ControllableComponent.hpp | 4 ++-- sources/Runner/Runner.cpp | 2 +- sources/System/Gamepad/GamepadSystem.cpp | 2 +- sources/System/Keyboard/KeyboardSystem.cpp | 2 +- sources/System/Lobby/LobbySystem.cpp | 8 ++++---- .../System/MenuControllable/MenuControllableSystem.cpp | 2 +- sources/System/Sound/MenuSoundManagerSystem.cpp | 2 +- sources/System/Sound/PlayerSoundManagerSystem.cpp | 6 +++--- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sources/Component/Controllable/ControllableComponent.hpp b/sources/Component/Controllable/ControllableComponent.hpp index 50c98e07..62c0bd13 100644 --- a/sources/Component/Controllable/ControllableComponent.hpp +++ b/sources/Component/Controllable/ControllableComponent.hpp @@ -31,8 +31,8 @@ namespace BBM //! @brief The X and Z abscis of the movement. Vector2f move; - //! @brief input value for jump - bool jump = false; + //! @brief input value to select + bool select = false; //! @brief input value for bomb bool bomb = false; //! @brief input value for pause diff --git a/sources/Runner/Runner.cpp b/sources/Runner/Runner.cpp index 6af5e04c..a8d1bf00 100644 --- a/sources/Runner/Runner.cpp +++ b/sources/Runner/Runner.cpp @@ -50,7 +50,7 @@ namespace BBM if (component.pause && gameState.currentScene == GameState::SceneID::GameScene) { gameState.nextScene = GameState::SceneID::PauseMenuScene; break; - } else if (gameState.currentScene == GameState::SceneID::SplashScreen && component.jump) { + } else if (gameState.currentScene == GameState::SceneID::SplashScreen && component.select) { gameState.nextScene = GameState::SceneID::TitleScreenScene; break; } diff --git a/sources/System/Gamepad/GamepadSystem.cpp b/sources/System/Gamepad/GamepadSystem.cpp index 623d5edd..7ff78016 100644 --- a/sources/System/Gamepad/GamepadSystem.cpp +++ b/sources/System/Gamepad/GamepadSystem.cpp @@ -24,7 +24,7 @@ namespace BBM Gamepad gamepad(gamepadComponent.getID()); const std::map keyPressedMap = { - {gamepadComponent.keyJump, controllable.jump}, + {gamepadComponent.keyJump, controllable.select}, {gamepadComponent.keyBomb, controllable.bomb}, {gamepadComponent.keyPause, controllable.pause} }; diff --git a/sources/System/Keyboard/KeyboardSystem.cpp b/sources/System/Keyboard/KeyboardSystem.cpp index 334b757a..8dbda5ab 100644 --- a/sources/System/Keyboard/KeyboardSystem.cpp +++ b/sources/System/Keyboard/KeyboardSystem.cpp @@ -22,7 +22,7 @@ namespace BBM auto &controllable = entity.get(); const std::map keyPressedMap = { - {keyboard.keyJump, controllable.jump}, + {keyboard.keyJump, controllable.select}, {keyboard.keyBomb, controllable.bomb}, {keyboard.keyPause, controllable.pause} }; diff --git a/sources/System/Lobby/LobbySystem.cpp b/sources/System/Lobby/LobbySystem.cpp index f11b9a7e..140f85c6 100644 --- a/sources/System/Lobby/LobbySystem.cpp +++ b/sources/System/Lobby/LobbySystem.cpp @@ -67,7 +67,7 @@ namespace BBM if (lobby.layout == ControllableComponent::NONE) { for (auto &[_, ctrl] : this->_wal.getScene()->view()) { auto &controller = ctrl; - if (controller.jump) { + if (controller.select) { if (std::any_of(this->getView().begin(), this->getView().end(), [&controller](WAL::ViewEntity &view) { return view.get().layout == controller.layout; })) @@ -76,7 +76,7 @@ namespace BBM lobby.color = -1; this->_nextColor(entity); lobby.layout = controller.layout; - controller.jump = false; + controller.select = false; return; } } @@ -85,10 +85,10 @@ namespace BBM for (auto &[_, controller] : this->_wal.getScene()->view()) { if (controller.layout != lobby.layout) continue; - if (controller.jump && !lobby.ready) { + if (controller.select && !lobby.ready) { lobby.ready = true; lobby.lastInput = lastTick; - controller.jump = false; + controller.select = false; this->_wal.getSystem().now = lastTick; auto *texture = dynamic_cast(lobby.readyButton.getComponent().drawable.get()); if (texture) diff --git a/sources/System/MenuControllable/MenuControllableSystem.cpp b/sources/System/MenuControllable/MenuControllableSystem.cpp index 6dcc95e3..d70ae7bc 100644 --- a/sources/System/MenuControllable/MenuControllableSystem.cpp +++ b/sources/System/MenuControllable/MenuControllableSystem.cpp @@ -60,6 +60,6 @@ namespace BBM } if (!this->_currentButton) return; - this->_updateCurrentButton(controllable.jump, controllable.move); + this->_updateCurrentButton(controllable.select, controllable.move); } } \ No newline at end of file diff --git a/sources/System/Sound/MenuSoundManagerSystem.cpp b/sources/System/Sound/MenuSoundManagerSystem.cpp index c1261f32..7f3e57e4 100644 --- a/sources/System/Sound/MenuSoundManagerSystem.cpp +++ b/sources/System/Sound/MenuSoundManagerSystem.cpp @@ -20,7 +20,7 @@ namespace BBM { std::map soundIndex = { {controllable.move.x, SoundComponent::MOVE}, {controllable.move.y, SoundComponent::MOVE}, - {controllable.jump, SoundComponent::JUMP}, + {controllable.select, SoundComponent::JUMP}, }; for (auto &a : soundIndex) { if (a.first) { diff --git a/sources/System/Sound/PlayerSoundManagerSystem.cpp b/sources/System/Sound/PlayerSoundManagerSystem.cpp index dac45304..4068a5e3 100644 --- a/sources/System/Sound/PlayerSoundManagerSystem.cpp +++ b/sources/System/Sound/PlayerSoundManagerSystem.cpp @@ -19,9 +19,9 @@ namespace BBM { sound.setVolume(sound.volume); std::map soundIndex = { - {health.getHealthPoint() <= 0, SoundComponent::DEATH}, - {controllable.bomb, SoundComponent::BOMB}, - {controllable.jump, SoundComponent::JUMP}, + {health.getHealthPoint() <= 0, SoundComponent::DEATH}, + {controllable.bomb, SoundComponent::BOMB}, + {controllable.select, SoundComponent::JUMP}, {controllable.move.x != 0 || controllable.move.y != 0, SoundComponent::MOVE} }; for (auto &a : soundIndex) {