pickup hanlder

This commit is contained in:
LorrensP-2158466
2025-04-06 15:08:25 +02:00
parent c7ed475278
commit 4bd1f1343e
9 changed files with 216 additions and 139 deletions

View File

@@ -13,6 +13,11 @@ impl Item {
pub fn none() -> Self {
Default::default()
}
// set item and return the current item
pub fn set_item(&mut self, item: Entity) -> Option<Entity> {
self.0.replace(item)
}
}
pub fn plugin(app: &mut App) {
@@ -20,7 +25,6 @@ pub fn plugin(app: &mut App) {
}
fn bottom_panel(mut egui_ctx: EguiContexts, item_query: Query<&Item, With<Player>>) {
dbg!(single!(item_query));
egui::TopBottomPanel::bottom("inventory_toolbar")
.frame(egui::Frame {
fill: egui::Color32::from_rgba_premultiplied(0, 0, 0, 0),