Have a separate container vs. item loot for the different situations where you're pick items out of a container vs. an item on the ground.
This commit is contained in:
parent
7db64b73c5
commit
af933c827a
4 changed files with 30 additions and 23 deletions
21
gui/fsm.cpp
21
gui/fsm.cpp
|
@ -575,14 +575,19 @@ namespace gui {
|
|||
dbc::log("there's no thing there!");
|
||||
}
|
||||
break;
|
||||
case eGUI::LOOT: {
|
||||
if(world.has<components::InventoryItem>(entity)) {
|
||||
auto gui_id = $loot_ui.$gui.entity("item_0");
|
||||
$loot_ui.contents.insert_or_assign(gui_id, entity);
|
||||
$loot_ui.update();
|
||||
} else {
|
||||
dbc::log("unhandled loot event.");
|
||||
}
|
||||
case eGUI::LOOT_ITEM: {
|
||||
dbc::check(world.has<components::InventoryItem>(entity),
|
||||
"INVALID LOOT_ITEM, that entity has no InventoryItem");
|
||||
auto gui_id = $loot_ui.$gui.entity("item_0");
|
||||
$loot_ui.contents.insert_or_assign(gui_id, entity);
|
||||
$loot_ui.update();
|
||||
event(Event::LOOT_OPEN);
|
||||
} break;
|
||||
case eGUI::LOOT_CONTAINER: {
|
||||
dbc::check(world.has<components::InventoryItem>(entity),
|
||||
"INVALID LOOT_ITEM, that entity has no InventoryItem");
|
||||
|
||||
dbc::log("everything is empty for now");
|
||||
event(Event::LOOT_OPEN);
|
||||
} break;
|
||||
case eGUI::HP_STATUS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue