The event router is working well and I can do drag-n-drop but I'll have to rethink where to use it.

This commit is contained in:
Zed A. Shaw 2025-06-05 23:31:38 -04:00
parent 5aa54d875f
commit c509162be1
8 changed files with 126 additions and 63 deletions

View file

@ -10,6 +10,7 @@ namespace gui {
IDLE,
MOUSE_ACTIVE,
MOUSE_MOVING,
MOUSE_DRAGGING
};
enum class Event {
@ -25,6 +26,8 @@ namespace gui {
sf::Vector2i position;
sf::Keyboard::Scancode scancode;
gui::Event $next_event = gui::Event::TICK;
int move_count = 0;
int $drag_tolerance = 4;
void event(Event ev);
@ -32,6 +35,7 @@ namespace gui {
void IDLE(Event ev);
void MOUSE_ACTIVE(Event ev);
void MOUSE_MOVING(Event ev);
void MOUSE_DRAGGING(Event ev);
gui::Event process_event(std::optional<sf::Event> ev);