Basic inventory system working and can pick up items but needs to be reflected in the UI next.

This commit is contained in:
Zed A. Shaw 2025-01-03 13:41:57 -05:00
parent d7353a02df
commit 135d9a128b
14 changed files with 212 additions and 48 deletions

View file

@ -240,11 +240,10 @@ void GUI::handle_world_events() {
}
} break;
case eGUI::LOOT: {
auto &loot = std::any_cast<Loot&>(data);
auto inventory = $world.get<Inventory>(player.entity);
auto &item = std::any_cast<InventoryItem&>(data);
auto &inventory = $world.get<Inventory>(player.entity);
fmt::println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!! UPDATE INVENTORY HERE.");
$sounds.play("loot_gold");
$status_ui.log(format("You found {} gold. You have {} now.",
loot.amount, inventory.gold));
}
break;
default: