Fixed a couple little bugs in the state so now can refactor out the dnd code.

master
Zed A. Shaw 4 weeks ago
parent 2a6b892e7f
commit 0d6a71b06f
  1. 5
      gui/fsm.cpp

@ -142,6 +142,7 @@ namespace gui {
// BUG: need a cancel operation here // BUG: need a cancel operation here
$window.setMouseCursorVisible(true); $window.setMouseCursorVisible(true);
$grab_source = std::nullopt; $grab_source = std::nullopt;
state(State::LOOTING);
} }
} break; } break;
case INV_SELECT: { case INV_SELECT: {
@ -184,7 +185,6 @@ namespace gui {
void FSM::INV_GRAB(Event ev, std::any data) { void FSM::INV_GRAB(Event ev, std::any data) {
using enum Event; using enum Event;
(void)data;
switch(ev) { switch(ev) {
case LOOT_OPEN: case LOOT_OPEN:
@ -214,6 +214,7 @@ namespace gui {
// BUG: need a cancel operation here // BUG: need a cancel operation here
//$window.setMouseCursorVisible(true); //$window.setMouseCursorVisible(true);
$grab_source = std::nullopt; $grab_source = std::nullopt;
state(State::LOOTING);
} }
} break; } break;
case MOUSE_CLICK: case MOUSE_CLICK:
@ -253,8 +254,8 @@ namespace gui {
state(State::IDLE); state(State::IDLE);
break; break;
case LOOT_SELECT: case LOOT_SELECT:
LOOT_GRAB(ev, data);
state(State::LOOT_GRAB); state(State::LOOT_GRAB);
LOOT_GRAB(ev, data);
break; break;
case INV_SELECT: case INV_SELECT:
state(State::INV_GRAB); state(State::INV_GRAB);

Loading…
Cancel
Save