diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-22 13:48:46 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-22 13:48:46 +0100 |
commit | 6a7e06f875d789af0e8f9b5ce0ad24b9eaa96d25 (patch) | |
tree | 07397ab46e2518fde4140777e2e181cde8ad938e /src/crepe/system/InputSystem.h | |
parent | 296c80edd6727d6808ed0c98c001a8b456f1c037 (diff) | |
parent | 61148c757a1f742ff09e40e5347e74e638c7371c (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r-- | src/crepe/system/InputSystem.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h index 2cb80e5..37311cc 100644 --- a/src/crepe/system/InputSystem.h +++ b/src/crepe/system/InputSystem.h @@ -23,7 +23,7 @@ public: /** * \param metadata Metadata of the button pressed */ - ButtonPressEvent(const Metadata & metadata) : metadata(metadata){}; + ButtonPressEvent(const Metadata & metadata) : metadata(metadata) {}; }; //! Event triggered when the mouse enters a button class ButtonEnterEvent : public Event { @@ -33,7 +33,7 @@ public: /** * \param metadata Metadata of the button pressed */ - ButtonEnterEvent(const Metadata & metadata) : metadata(metadata){}; + ButtonEnterEvent(const Metadata & metadata) : metadata(metadata) {}; }; //! Event triggered when the mouse leaves a button class ButtonExitEvent : public Event { @@ -43,7 +43,7 @@ public: /** * \param metadata Metadata of the button pressed */ - ButtonExitEvent(const Metadata & metadata) : metadata(metadata){}; + ButtonExitEvent(const Metadata & metadata) : metadata(metadata) {}; }; /** @@ -79,8 +79,9 @@ private: * This method processes mouse events, adjusts the mouse position to world coordinates, * and triggers the appropriate mouse-specific event handling logic. */ - void handle_mouse_event(const EventData & event, const vec2 & camera_origin, - const Camera & current_cam); + void handle_mouse_event( + const EventData & event, const vec2 & camera_origin, const Camera & current_cam + ); /** * \brief Handles non-mouse-related events. * \param event The event data for the non-mouse event. @@ -98,8 +99,9 @@ private: * * This method processes the mouse click event and triggers the corresponding button action. */ - void handle_click(const MouseButton & mouse_button, const vec2 & mouse_pos, - const Camera & current_cam); + void handle_click( + const MouseButton & mouse_button, const vec2 & mouse_pos, const Camera & current_cam + ); /** * \brief Handles the mouse movement event. @@ -110,8 +112,9 @@ private: * * This method processes the mouse movement event and updates the button hover state. */ - void handle_move(const EventData & event_data, const vec2 & mouse_pos, - const Camera & current_cam); + void handle_move( + const EventData & event_data, const vec2 & mouse_pos, const Camera & current_cam + ); /** * \brief Checks if the mouse position is inside the bounds of the button. @@ -122,8 +125,10 @@ private: * \param cam_transform the transform of the current active camera * \return True if the mouse is inside the button, false otherwise. */ - bool is_mouse_inside_button(const vec2 & mouse_pos, const Button & button, - const Transform & transform, const Transform & cam_transform); + bool is_mouse_inside_button( + const vec2 & mouse_pos, const Button & button, const Transform & transform, + const Transform & cam_transform + ); /** * \brief Handles the button press event, calling the on_click callback if necessary. |