Quick prototype of how switch to an icon during pickup makes the rendering bug go away and also looks better visually.

master
Zed A. Shaw 10 months ago
parent 6f91533950
commit b311713064
  1. 10
      assets/config.json
  2. BIN
      assets/icons/healing_potion_small_ICON.png
  3. BIN
      assets/icons/torch_crappy_ICON.png
  4. 2
      gui/loot_ui.cpp
  5. 2
      gui/status_ui.cpp

@ -80,6 +80,11 @@
"frame_width": 256,
"frame_height": 256
},
"torch_horizontal_floor_ICON":
{"path": "assets/icons/torch_crappy_ICON.png",
"frame_width": 128,
"frame_height": 128
},
"peasant_girl":
{"path": "assets/sprites/peasant_girl_2.png",
"frame_width": 256,
@ -95,6 +100,11 @@
"frame_width": 256,
"frame_height": 256
},
"healing_potion_small_ICON":
{"path": "assets/icons/healing_potion_small_ICON.png",
"frame_width": 128,
"frame_height": 128
},
"well_down":
{"path": "assets/sprites/well_down.png",
"frame_width": 256,

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

@ -75,7 +75,7 @@ namespace gui {
dbc::check($level.world->has<components::Sprite>(item),
"item in inventory UI doesn't exist in world. New level?");
auto& sprite = $level.world->get<components::Sprite>(item);
$gui.set_init<guecs::Sprite>(id, {sprite.name});
$gui.set_init<guecs::Sprite>(id, {fmt::format("{}_ICON", sprite.name)});
guecs::GrabSource grabber{
item, [&, id]() { return remove_slot(id); }};

@ -80,7 +80,7 @@ namespace gui {
auto gui_id = $gui.entity(slot);
auto& sprite = $level.world->get<components::Sprite>(world_entity);
$gui.set_init<guecs::Sprite>(gui_id, {sprite.name});
$gui.set_init<guecs::Sprite>(gui_id, {fmt::format("{}_ICON", sprite.name)});
guecs::GrabSource grabber{ world_entity,
[&, gui_id]() { return remove_slot(gui_id); }};
grabber.setSprite($gui, gui_id);