Initial loot UI works to load an item by its world entity ID.
This commit is contained in:
parent
f208ca946e
commit
4b34de2109
6 changed files with 67 additions and 20 deletions
15
gui/fsm.cpp
15
gui/fsm.cpp
|
@ -177,10 +177,19 @@ namespace gui {
|
|||
case TICK:
|
||||
// do nothing
|
||||
break;
|
||||
case LOOT_OPEN:
|
||||
case LOOT_OPEN: {
|
||||
dbc::log("IDLE LOOT OPEN!");
|
||||
Config items("assets/items.json");
|
||||
auto& data = items["TORCH_BAD"];
|
||||
auto torch = $level.world->entity();
|
||||
components::configure_entity(*$level.world, torch, data["components"]);
|
||||
$loot_ui.contents.push_back(torch);
|
||||
$loot_ui.update();
|
||||
$loot_ui.active = true;
|
||||
|
||||
state(State::LOOTING);
|
||||
break;
|
||||
|
||||
} break;
|
||||
default:
|
||||
dbc::sentinel("unhandled event in IDLE");
|
||||
}
|
||||
|
@ -384,7 +393,7 @@ namespace gui {
|
|||
System::collision($level);
|
||||
System::motion($level);
|
||||
System::lighting($level);
|
||||
System::death($level, $levels.$components);
|
||||
System::death($level);
|
||||
}
|
||||
|
||||
bool FSM::active() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue