mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 13:25:10 +00:00
Making menues selectable by keyboard or controller
This commit is contained in:
@@ -14,41 +14,26 @@ namespace BBM
|
||||
class MenuControllableSystem : public WAL::System<ControllableComponent>
|
||||
{
|
||||
private:
|
||||
//! @brief reference to wal
|
||||
WAL::Wal &wal;
|
||||
|
||||
//! @brief index of the current button selected
|
||||
WAL::Entity *currentButton;
|
||||
|
||||
//! @brief move vector
|
||||
Vector2f move;
|
||||
|
||||
//! @brief Select action
|
||||
bool select = false;
|
||||
|
||||
//! @brief Cancel action
|
||||
bool cancel = false;
|
||||
WAL::Entity *_currentButton;
|
||||
|
||||
//! @brief update current button reference
|
||||
//! @param selected lets know if te new selected button is 'pressed'
|
||||
void updateCurrentButton(bool selected);
|
||||
void _updateCurrentButton(bool selected, Vector2f move);
|
||||
|
||||
//! @brief time (in mili second) since last check
|
||||
//! @brief time (in millisecond) since last check
|
||||
std::chrono::time_point<std::chrono::steady_clock> _now;
|
||||
public:
|
||||
//! @inherit
|
||||
void onSelfUpdate(void) override;
|
||||
|
||||
//! @inherit
|
||||
void onFixedUpdate(WAL::ViewEntity<ControllableComponent> &entities) override;
|
||||
|
||||
//! @brief A default constructor
|
||||
MenuControllableSystem(WAL::Wal &wal);
|
||||
explicit MenuControllableSystem(WAL::Wal &wal);
|
||||
//! @brief A MenuControllable system is not copy constructable
|
||||
MenuControllableSystem(const MenuControllableSystem &) = delete;
|
||||
//! @brief A default destructor
|
||||
~MenuControllableSystem() override = default;
|
||||
//! @brief A MenuControllable system is assignable.
|
||||
MenuControllableSystem &operator=(const MenuControllableSystem &) = default;
|
||||
//! @brief A MenuControllable system is not assignable.
|
||||
MenuControllableSystem &operator=(const MenuControllableSystem &) = delete;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user