Very simple items system to get into the inventory work.

This commit is contained in:
Zed A. Shaw 2025-01-01 13:21:01 -05:00
parent 1962b0c24e
commit 3d461bce6d
15 changed files with 94 additions and 32 deletions

View file

@ -52,6 +52,7 @@ void StatusUI::create_render() {
auto status_rend = Renderer([&, player]{
const auto& player_combat = $world.get<Combat>(player.entity);
const auto& inventory = $world.get<Inventory>(player.entity);
const auto& combat = $world.get<Combat>(player.entity);
$status_text = player_combat.hp > 0 ? "NOT DEAD" : "DEAD!!!!!!";
std::vector<Element> log_list;
@ -64,8 +65,10 @@ void StatusUI::create_render() {
return hbox({
hflow(
vbox(
text(format("HP: {: >3} GOLD: {: >3}",
player_combat.hp, inventory.gold)) | border,
text(format("HP: {: >3} GOLD: {: >3} DMG: {: >3}",
player_combat.hp,
inventory.gold,
combat.damage)) | border,
text($status_text) | border,
separator(),
log_box