Worked out the status UI more, setup the color scheme, and fixed various small problems with looting causing a crash.

This commit is contained in:
Zed A. Shaw 2026-03-29 13:15:39 -04:00
parent db60f75bd9
commit 36a49ef768
6 changed files with 48 additions and 40 deletions

View file

@ -16,8 +16,16 @@ namespace gui {
{
$gui.position(x, y, width, height);
$gui.layout(
"[=slot1]"
"[=slot2]"
"[=body_head]"
"[=body_chest]"
"[=body_right_arm]"
"[=body_left_arm]"
"[=body_stomach]"
"[=body_left_leg]"
"[=body_right_leg]"
"[=inv0|=inv1|=inv2]"
"[=inv3|=inv4|=inv5]"
"[=inv6|=inv7|=inv8]"
"[=hand_r]"
"[=pocket_l]");
}
@ -28,17 +36,22 @@ namespace gui {
for(auto& [name, cell] : $gui.cells()) {
auto gui_id = $gui.entity(name);
$gui.set<Rectangle>(gui_id, {});
$gui.set<Text>(gui_id, {guecs::to_wstring(name)});
$gui.set<Clickable>(gui_id, {
guecs::make_action(gui_id, game::Event::INV_SELECT, {gui_id})
});
$gui.set<DropTarget>(gui_id, {
.commit=[&, gui_id](DinkyECS::Entity world_target) -> bool {
return place_slot(gui_id, world_target);
}
});
if(name.starts_with("body_")) {
$gui.set<Meter>(gui_id, {});
} else {
$gui.set<Rectangle>(gui_id, {});
$gui.set<Clickable>(gui_id, {
guecs::make_action(gui_id, game::Event::INV_SELECT, {gui_id})
});
$gui.set<DropTarget>(gui_id, {
.commit=[&, gui_id](DinkyECS::Entity world_target) -> bool {
return place_slot(gui_id, world_target);
}
});
}
}
$gui.init();