From bb4e13e663620c3a75b00b5ff56140c8f218e32c Mon Sep 17 00:00:00 2001 From: Rich Churcher Date: Sun, 17 Nov 2024 17:40:32 +1300 Subject: [PATCH] Draggable is a hard word to spell --- examples/picking/ui_picking.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/picking/ui_picking.rs b/examples/picking/ui_picking.rs index be1cce8234..ea0767c5c0 100644 --- a/examples/picking/ui_picking.rs +++ b/examples/picking/ui_picking.rs @@ -31,7 +31,7 @@ struct InventorySlot; /// Marker component for entities which can be dragged. #[derive(Component)] -struct Dragable; +struct Draggable; /// Marker component for entities which are currently being dragged, and should follow the pointer. #[derive(Component)] @@ -104,11 +104,11 @@ fn spawn_inventory_slot(mut commands: Commands, inventory: Single impl Fn( Trigger>, Commands, - Query<(Entity, &mut Node, &mut Transform, &Parent), With>, + Query<(Entity, &mut Node, &mut Transform, &Parent), With>, ResMut, ) { - move |ev, mut commands, mut dragable, mut drag_details| { - let Ok((item, mut item_node, mut transform, parent)) = dragable.get_mut(ev.target) else { + move |ev, mut commands, mut draggable, mut drag_details| { + let Ok((item, mut item_node, mut transform, parent)) = draggable.get_mut(ev.target) else { return; }; @@ -169,7 +169,7 @@ fn drag_end() -> impl Fn( /// need to check the type of the `ev.target` because we've only attached this observer to /// `InventorySlot`s. fn set_drop_target( -) -> impl Fn(Trigger>, Query<(), With>, ResMut) { +) -> impl Fn(Trigger>, Query<(), With>, ResMut) { move |ev, draggables, mut details| { // Don't try to drop the item on an existing item if draggables.get(ev.target).is_ok() { @@ -220,7 +220,7 @@ fn add_items_to_inventory( commands.entity(slot).with_children(|parent| { parent .spawn(( - Dragable, + Draggable, // This node serves solely to be dragged! It provides the transform, using required // components. Node::default(),