Big BIG refactor to make inventory use a model that's placed into the world, following a more sane MVC style.
This commit is contained in:
parent
119b3ed11d
commit
a0eff927b6
21 changed files with 270 additions and 123 deletions
11
gui/fsm.cpp
11
gui/fsm.cpp
|
@ -6,7 +6,6 @@
|
|||
#include "components.hpp"
|
||||
#include <numbers>
|
||||
#include "systems.hpp"
|
||||
#include "gui/uisystems.hpp"
|
||||
#include "gui/fsm_events.hpp"
|
||||
#include "events.hpp"
|
||||
#include "sound.hpp"
|
||||
|
@ -69,7 +68,6 @@ namespace gui {
|
|||
|
||||
run_systems();
|
||||
|
||||
this_crap_must_die();
|
||||
state(State::IDLE);
|
||||
}
|
||||
|
||||
|
@ -461,8 +459,7 @@ namespace gui {
|
|||
dbc::check(world.has<components::InventoryItem>(entity),
|
||||
"INVALID LOOT_ITEM, that entity has no InventoryItem");
|
||||
dbc::log("@@@@ SENDING LOOT_ITEM");
|
||||
auto gui_id = $loot_ui.$gui.entity("item_0");
|
||||
$loot_ui.contents.insert_or_assign(gui_id, entity);
|
||||
$loot_ui.contents.add("item_0", entity);
|
||||
$loot_ui.update();
|
||||
event(Event::LOOT_ITEM);
|
||||
} break;
|
||||
|
@ -517,10 +514,4 @@ namespace gui {
|
|||
|
||||
run_systems();
|
||||
}
|
||||
|
||||
void FSM::this_crap_must_die() {
|
||||
auto torch_id = System::spawn_item($level, "TORCH_BAD");
|
||||
auto hand_l = $status_ui.$gui.entity("hand_l");
|
||||
$status_ui.place_slot(hand_l, torch_id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue