@@ 19,6 19,6 @@ exhaust_temperature = 1000.0
heat_constant = 10.0
[[joint]]
-id = "Top"
-target = { translation = [ 0.0, 55.0, 0.0 ], rotation = 0.0 }
-snap = { translation = [ 0.0, 25.0, 0.0 ], rotation = 0.0 }
+id = "Bottom"
+target = { translation = [ 0.0, -55.0, 0.0 ], rotation = -180.0 }
+snap = { translation = [ 0.0, -25.0, 0.0 ], rotation = 0.0 }
@@ 19,6 19,6 @@ exhaust_temperature = 1000.0
heat_constant = 10.0
[[joint]]
-id = "Top"
-target = { translation = [ 0.0, 55.0, 0.0 ], rotation = 0.0 }
-snap = { translation = [ 0.0, 25.0, 0.0 ], rotation = 0.0 }
+id = "Bottom"
+target = { translation = [ 0.0, -55.0, 0.0 ], rotation = -180.0 }
+snap = { translation = [ 0.0, -25.0, 0.0 ], rotation = 0.0 }
@@ 78,7 78,7 @@ fn on_click(
mut drag: ResMut<ShipEditorDrag>,
camera: Single<&Transform, (With<Camera2d>, With<MainCamera>)>,
window: Single<&Window, With<PrimaryWindow>>,
- mut ghost_module: Query<(Entity, &mut Transform, &mut Sprite, &Joints), (With<GhostModule>, Without<MainCamera>)>,
+ mut ghost_module: Query<(Entity, &mut Transform, &mut Sprite, &Joints, &PartConfigHolder), (With<GhostModule>, Without<MainCamera>)>,
snaps: Query<(&SnapOf, &SnapOfJoint)>,
joints: Query<(&Joint, &JointOf, &Transform, Option<&Peer>, Entity), (Without<GhostModule>, Without<MainCamera>)>,
mut parts: Query<
@@ 104,7 104,7 @@ fn on_click(
drag.is_dragging = false;
if let Some(snap_target) = drag.target && let Some(peer_snap) = drag.peer {
- let Ok((ghost_entity, mut ghost_transform, mut ghost_sprite, ghost_joints)) = ghost_module.single_mut() else { return };
+ let Ok((ghost_entity, mut ghost_transform, mut ghost_sprite, ghost_joints, ghost_config)) = ghost_module.single_mut() else { return };
let Ok((target_snap_part, target_snap_joint)) = snaps.get(snap_target) else {
return;
};
@@ 152,6 152,7 @@ fn on_click(
* Quat::from_rotation_z(PI as f32);
debug!("spawning part");
+ ghost_sprite.image = asset_server.load(ghost_config.0.part.sprite_connected.clone());
ghost_sprite.color = Color::srgb(1.0, 1.0, 1.0);
commands.entity(ghost_entity)
.insert(Part)