diff --git a/assets/palette.json b/assets/palette.json index e3c68e1..856bf04 100644 --- a/assets/palette.json +++ b/assets/palette.json @@ -5,17 +5,17 @@ }, "gui/theme": { "black": [0, 0, 0, 255], - "dark_dark": [10, 10, 10, 255], - "dark_mid": [30, 30, 30, 255], - "dark_light": [60, 60, 60, 255], - "mid": [100, 100, 100, 255], - "light_dark": [150, 150, 150, 255], - "light_mid": [200, 200, 200, 255], - "light_light": [230, 230, 230, 255], + "dark_dark": [22, 10, 7, 255], + "dark_mid": [53, 25, 18, 255], + "dark_light": [91, 42, 31, 255], + "mid": [142, 65, 48, 255], + "light_dark": [193, 89, 65, 255], + "light_mid": [255, 117, 86, 255], + "light_light": [255, 194, 181, 255], "white": [255, 255, 255, 255], - "fill_color": "gui/theme:dark_mid", - "text_color": "gui/theme:light_light", - "bg_color": "gui/theme:mid", + "fill_color": [28, 29, 33, 255], + "text_color": [209, 209, 209, 255], + "bg_color": "gui/theme:dark_light", "border_color": "gui/theme:dark_dark", "bg_color_dark": "gui/theme:black" }, diff --git a/src/game/systems.cpp b/src/game/systems.cpp index 0dffdc1..09bd01f 100644 --- a/src/game/systems.cpp +++ b/src/game/systems.cpp @@ -167,16 +167,15 @@ void System::distribute_loot(Position target_pos) { auto loot_entity = world.entity(); if(inventory_count > 0) { - auto& entity_data = config.devices["DEAD_BODY_LOOTABLE"]; - components::configure_entity(world, loot_entity, entity_data["components"]); - // BUG: inventory_count here isn't really used to remove it - world.set(loot_entity, {inventory_count, entity_data}); - } else { - // this creates a dead body on the ground - auto& entity_data = config.devices["DEAD_BODY"]; - components::configure_entity(world, loot_entity, entity_data["components"]); + dbc::log("!!!!!!!!!!!!!!!! ============= LOOTING BODIES NOT READY"); } + // NOTE: refer to the code in raycaster for this + + // this creates a dead body on the ground + auto& entity_data = config.devices["DEAD_BODY"]; + components::configure_entity(world, loot_entity, entity_data["components"]); + set_position(world, *level.collision, loot_entity, target_pos); level.world->send(game::Event::ENTITY_SPAWN, loot_entity, {}); } diff --git a/src/gui/loot_ui.cpp b/src/gui/loot_ui.cpp index c76049a..07c55b4 100644 --- a/src/gui/loot_ui.cpp +++ b/src/gui/loot_ui.cpp @@ -78,6 +78,7 @@ namespace gui { dbc::check(world->has(item), "item in inventory UI doesn't exist in world. New level?"); auto& sprite = world->get(item); + fmt::println("!!!!!!!!!!! trying to load {}", sprite.name); $gui.set_init(id, {sprite.name}); guecs::GrabSource grabber{ diff --git a/src/gui/overlay_ui.cpp b/src/gui/overlay_ui.cpp index 8d797b0..6f16f71 100644 --- a/src/gui/overlay_ui.cpp +++ b/src/gui/overlay_ui.cpp @@ -18,12 +18,13 @@ namespace gui { $gui.init(); } - inline void make_clickable_area(guecs::UI &gui, const std::string &name) { + inline void make_clickable_area(guecs::UI &gui, const std::string name) { auto area = gui.entity(name); gui.set(area, { - [&](auto) { + [=](auto) { auto world = GameDB::current_world(); + fmt::println("CLICK {}", name); world->send(game::Event::AIM_CLICK, area, {}); } }); diff --git a/src/gui/status_ui.cpp b/src/gui/status_ui.cpp index 3dbdeb5..7dd689e 100644 --- a/src/gui/status_ui.cpp +++ b/src/gui/status_ui.cpp @@ -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(gui_id, {}); $gui.set(gui_id, {guecs::to_wstring(name)}); - $gui.set(gui_id, { - guecs::make_action(gui_id, game::Event::INV_SELECT, {gui_id}) - }); - $gui.set(gui_id, { - .commit=[&, gui_id](DinkyECS::Entity world_target) -> bool { - return place_slot(gui_id, world_target); - } - }); + + if(name.starts_with("body_")) { + $gui.set(gui_id, {}); + } else { + $gui.set(gui_id, {}); + $gui.set(gui_id, { + guecs::make_action(gui_id, game::Event::INV_SELECT, {gui_id}) + }); + $gui.set(gui_id, { + .commit=[&, gui_id](DinkyECS::Entity world_target) -> bool { + return place_slot(gui_id, world_target); + } + }); + } } $gui.init(); diff --git a/tests/palette.cpp b/tests/palette.cpp index a96ad81..a38ad8e 100644 --- a/tests/palette.cpp +++ b/tests/palette.cpp @@ -11,14 +11,8 @@ TEST_CASE("color palette test", "[color-palette]") { // confirm it's idempotent palette::init(); - sf::Color expect{10, 10, 10, 255}; - auto gui_text = palette::get("gui/theme:dark_dark"); - REQUIRE(gui_text == expect); - - gui_text = palette::get("gui/theme", "mid"); - REQUIRE(gui_text != expect); - - expect = {100, 100, 100, 255}; - REQUIRE(gui_text == expect); + REQUIRE(gui_text.r > 0); + REQUIRE(gui_text.g > 0); + REQUIRE(gui_text.b > 0); }