@@ 11,7 11,7 @@ use crate::client::input::ClientAction;
use crate::ecs::thruster::{PartThrusters, Thruster, ThrusterOfPart};
use crate::prelude::*;
use crate::client::input::util::ActionStateExt;
-use crate::ecs::Me;
+use crate::ecs::{Me, ThrustEvent};
use crate::thrust::ThrustSolution;
pub fn client_thrusters_plugin(app: &mut App) {
@@ 60,6 60,7 @@ fn solve_thrust(
thrusters: Query<(&Thruster, &GlobalTransform)>,
input: Res<ActionState<ClientAction>>,
mut solution: ResMut<ThrustSolution>,
+ mut events: MessageWriter<ThrustEvent>,
) {
if !(
input.button_changed(&ClientAction::ThrustForward)
@@ 107,6 108,7 @@ fn solve_thrust(
debug!("no buttons are pressed; zeroing thrust solution");
debug!("solved thrust in {}ms", start.elapsed().as_millis());
solution.converged = true;
+ events.write(ThrustEvent(solution.clone()));
return;
}
@@ 211,5 213,6 @@ fn solve_thrust(
debug!("found thrust solution in {:?}", start.elapsed());
*solution = new_soln;
+ events.write(ThrustEvent(solution.clone()));
return;
}=
\ No newline at end of file