diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-08 15:03:14 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-08 15:03:14 +0100 |
commit | 261a2cfd2bedafbc7fcf54e1b86adee206dea519 (patch) | |
tree | f099bca292e99ae54035f9a5ac7a455eec073c3e /game/menus/IButtonScript.cpp | |
parent | d9c67da9b8c2d8d25ef4dd2c700ddc78573d3a60 (diff) | |
parent | 0b9574bdd6c5968c07bcf165d66032b75649b5da (diff) |
merge w/ master
Diffstat (limited to 'game/menus/IButtonScript.cpp')
-rw-r--r-- | game/menus/IButtonScript.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/game/menus/IButtonScript.cpp b/game/menus/IButtonScript.cpp index da535ca..34efbd0 100644 --- a/game/menus/IButtonScript.cpp +++ b/game/menus/IButtonScript.cpp @@ -2,30 +2,31 @@ #include "system/InputSystem.h" -#include <crepe/types.h> #include <crepe/api/Sprite.h> +#include <crepe/types.h> using namespace crepe; using namespace std; -void IButtonScript::init(){ - this->subscribe<ButtonExitEvent>([this](const ButtonExitEvent& e) { return this->on_button_exit(e); }); - this->subscribe<ButtonEnterEvent>([this](const ButtonEnterEvent& e) { return this->on_button_enter(e); }); +void IButtonScript::init() { + this->subscribe<ButtonExitEvent>([this](const ButtonExitEvent & e) { + return this->on_button_exit(e); + }); + this->subscribe<ButtonEnterEvent>([this](const ButtonEnterEvent & e) { + return this->on_button_enter(e); + }); } -bool IButtonScript::on_button_exit(const ButtonExitEvent& e){ +bool IButtonScript::on_button_exit(const ButtonExitEvent & e) { RefVector<Sprite> sprites = this->get_components<Sprite>(); - for(Sprite & sprite : sprites) - { - sprite.data.color = Color{255,255,255,255}; + for (Sprite & sprite : sprites) { + sprite.data.color = Color {255, 255, 255, 255}; } return false; } -bool IButtonScript::on_button_enter(const ButtonEnterEvent& e){ +bool IButtonScript::on_button_enter(const ButtonEnterEvent & e) { RefVector<Sprite> sprites = this->get_components<Sprite>(); - for(Sprite & sprite : sprites) - { - sprite.data.color = Color{200,200,200,255}; + for (Sprite & sprite : sprites) { + sprite.data.color = Color {200, 200, 200, 255}; } return false; } - |