Loot UI now opens when you can loot something, but it's still buggy and doesn't always show the stuff.

This commit is contained in:
Zed A. Shaw 2025-06-12 00:10:21 -04:00
parent 86eabed3db
commit 2458f01ebd
2 changed files with 7 additions and 9 deletions

View file

@ -568,10 +568,13 @@ namespace gui {
event(Event::INV_SELECT, data);
break;
case eGUI::LOOT: {
dbc::check(world.has<components::Sprite>(entity), "inventory doesn't have a sprite");
auto gui_id = $loot_ui.$gui.entity("item_0");
$loot_ui.contents.insert_or_assign(gui_id, entity);
$loot_ui.update();
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.");
}
event(Event::LOOT_OPEN);
} break;
case eGUI::HP_STATUS: