#pragma once #include #include #include #include #include #include #include "input.h" #include "ui/window_message.h" namespace Options { struct Gamepad; } class DefineButtons { public: struct Button { std::string label; Input::Action action; SDL_GamepadButton button; Button(std::string label, Input::Action action, SDL_GamepadButton button) : label(std::move(label)), action(action), button(button) {} }; DefineButtons(); ~DefineButtons() = default; void render(); void update(); void checkEvents(const SDL_Event &event); auto enable(Options::Gamepad *options_gamepad) -> bool; void disable(); [[nodiscard]] auto isEnabled() const -> bool { return enabled_; } [[nodiscard]] auto isFinished() const -> bool { return finished_; } private: Input *input_ = nullptr; std::unique_ptr window_message_; bool enabled_ = false; bool finished_ = false; std::vector