Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/launching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,20 @@ fn on_hover_collector_over(
ev: On<Pointer<Over>>,
mut commands: Commands,
query: Query<Entity, With<NavigationInstruments>>,
mut thruster_query: Query<&mut Thruster>,
) {
// Hover only indicates potential selection; do not modify thrusters here
//println!("hover over collector {:?}", ev.entity);
commands.entity(ev.entity).insert(NavigationInstruments);

// Remove selection marker from others
// Remove selection marker from others and deactivate their thrusters
for entity in query.iter() {
if entity != ev.entity {
commands.entity(entity).remove::<NavigationInstruments>();
// Deactivate thruster when removing navigation instruments
if let Ok(mut thruster) = thruster_query.get_mut(entity) {
thruster.active = false;
}
}
}
}
Expand Down Expand Up @@ -528,5 +533,4 @@ fn sun_thruster_touch(
_ => {}
}
}
}

}