Fix the last few loot bugs before actually implementing the data model for inventory and loot.

This commit is contained in:
Zed A. Shaw 2025-06-10 22:58:57 -04:00
parent 4a48910273
commit d6c5a89251
3 changed files with 25 additions and 36 deletions

View file

@ -136,6 +136,7 @@ namespace gui {
case LOOT_SELECT: {
auto gui_id = std::any_cast<guecs::Entity>(data);
$grab_source = UISystem::loot_grab($loot_ui.$gui, gui_id);
if(!$grab_source) state(State::LOOTING);
} break;
case INV_SELECT: {
if($grab_source) {
@ -195,8 +196,9 @@ namespace gui {
}
} break;
case INV_SELECT: {
auto gui_id = std::any_cast<DinkyECS::Entity>(data);
$grab_source = UISystem::loot_grab($status_ui.$gui, gui_id);
auto gui_id = std::any_cast<DinkyECS::Entity>(data);
$grab_source = UISystem::loot_grab($status_ui.$gui, gui_id);
if(!$grab_source) state(State::LOOTING);
} break;
case MOUSE_CLICK:
mouse_action(false);
@ -228,16 +230,16 @@ namespace gui {
$loot_ui.active = false;
state(State::IDLE);
break;
case LOOT_SELECT:
// BUG: this actually should init the select, so that in LOOT_GRAB
// I can allow people to place it back into the loot ui
state(State::LOOT_GRAB);
LOOT_GRAB(ev, data);
break;
case INV_SELECT:
state(State::INV_GRAB);
INV_GRAB(ev, data);
break;
case LOOT_SELECT: {
auto gui_id = std::any_cast<guecs::Entity>(data);
$grab_source = UISystem::loot_grab($loot_ui.$gui, gui_id);
if($grab_source) state(State::LOOT_GRAB);
} break;
case INV_SELECT: {
auto gui_id = std::any_cast<DinkyECS::Entity>(data);
$grab_source = UISystem::loot_grab($status_ui.$gui, gui_id);
if($grab_source) state(State::INV_GRAB);
} break;
case MOUSE_DRAG_START:
case MOUSE_CLICK:
mouse_action(false);