Level traversal works, but it's very immediate. Next is a little 'confirm level' modal and a transition screen.
This commit is contained in:
parent
1886c99920
commit
29e6d45dc6
14 changed files with 98 additions and 43 deletions
|
@ -59,15 +59,17 @@ namespace gui {
|
|||
auto& inventory = world->get<components::Inventory>($level.player);
|
||||
size_t inv_id = $slots[any_cast<string>(slot_name)];
|
||||
|
||||
auto [used, name] = inventory.use($level, inv_id);
|
||||
if(inventory.has_item(inv_id)) {
|
||||
auto [used, name] = inventory.use($level, inv_id);
|
||||
|
||||
if(used) {
|
||||
log(fmt::format("Used item: {}", name));
|
||||
} else {
|
||||
log(fmt::format("You are out of {}.", name));
|
||||
if(used) {
|
||||
log(fmt::format("Used item: {}", name));
|
||||
} else {
|
||||
log(fmt::format("You are out of {}.", name));
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,4 +120,9 @@ namespace gui {
|
|||
$messages.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
void StatusUI::update_level(GameLevel &level) {
|
||||
$level = level;
|
||||
render();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue