Initial first steps in pulling the SFML event processing out of the gui::fsm so that I can handle more complex things like drag and drop.

This commit is contained in:
Zed A. Shaw 2025-06-05 01:23:52 -04:00
parent 0674908e49
commit 5aa54d875f
9 changed files with 194 additions and 146 deletions

View file

@ -10,6 +10,8 @@
#include "gui/boss_fight_ui.hpp"
#include "gui/map_view.hpp"
#include "gui/mini_map.hpp"
#include "events.hpp"
#include "gui/event_router.hpp"
namespace gui {
enum class State {
@ -25,27 +27,6 @@ namespace gui {
END
};
enum class Event {
STARTED=0,
TICK=1,
MOVE_FORWARD = 2,
MOVE_BACK = 3,
MOVE_LEFT = 4,
MOVE_RIGHT = 5,
MAP_OPEN = 6,
CLOSE = 7,
ROTATE_LEFT = 8,
ROTATE_RIGHT = 9,
ATTACK = 10,
START_COMBAT = 11,
STOP_COMBAT = 12,
STAIRS_DOWN = 13,
LOOT_OPEN=14,
LOOT_SELECT=15,
LOOT_PLACE=16,
QUIT = 17
};
class FSM : public DeadSimpleFSM<State, Event> {
public:
sf::RenderWindow $window;
@ -64,6 +45,7 @@ namespace gui {
MiniMapUI $mini_map;
LootUI $loot_ui;
sf::Font $font;
gui::routing::Router $router;
FSM();