|
|
@ -89,7 +89,8 @@ namespace gui { |
|
|
|
if($level.world->has<components::Sprite>(world_entity)) { |
|
|
|
if($level.world->has<components::Sprite>(world_entity)) { |
|
|
|
auto& sprite = $level.world->get<components::Sprite>(world_entity); |
|
|
|
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, {sprite.name}); |
|
|
|
$gui.set<guecs::GrabSource>(gui_id, {world_entity}); |
|
|
|
$gui.set<guecs::GrabSource>(gui_id, {world_entity, |
|
|
|
|
|
|
|
[&, gui_id]() { return remove_slot(gui_id); }}); |
|
|
|
contents.insert_or_assign(gui_id, world_entity); |
|
|
|
contents.insert_or_assign(gui_id, world_entity); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -107,9 +108,11 @@ namespace gui { |
|
|
|
return $gui.get<guecs::GrabSource>(gui_id); |
|
|
|
return $gui.get<guecs::GrabSource>(gui_id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void StatusUI::commit_grab(DinkyECS::Entity slot_id) { |
|
|
|
void StatusUI::remove_slot(DinkyECS::Entity slot_id) { |
|
|
|
|
|
|
|
if(contents.contains(slot_id)) { |
|
|
|
contents.erase(slot_id); |
|
|
|
contents.erase(slot_id); |
|
|
|
$gui.remove<guecs::GrabSource>(slot_id); |
|
|
|
$gui.remove<guecs::GrabSource>(slot_id); |
|
|
|
$gui.remove<guecs::Sprite>(slot_id); |
|
|
|
$gui.remove<guecs::Sprite>(slot_id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|