From 469fe14a4cbf5336ffb226754f5590ca540d854d Mon Sep 17 00:00:00 2001 From: Mikkel Rasmussen Date: Sun, 17 Sep 2023 19:53:52 +0200 Subject: [PATCH] fmt & clippy --- src/drivers/fpv.rs | 6 +++--- src/drivers/orbit.rs | 6 +++--- src/lib.rs | 13 ++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/drivers/fpv.rs b/src/drivers/fpv.rs index f23b553..fcc51c6 100644 --- a/src/drivers/fpv.rs +++ b/src/drivers/fpv.rs @@ -15,9 +15,9 @@ pub struct CCFpv; impl Plugin for CCFpv { fn build(&self, app: &mut App) { app.add_rig_component(CCFpv) - .add_startup_system(setup_fpv) + .add_systems(Startup, setup_fpv) .add_state::() - .add_system(update_fpv_camera); + .add_systems(Update, update_fpv_camera); } } @@ -63,7 +63,7 @@ pub fn update_fpv_camera( ) { let time_delta_seconds: f32 = time.delta_seconds(); let boost_mult = 5.0f32; - let sensitivity = Vec2::splat(1.0); + let _sensitivity = Vec2::splat(1.0); let mut move_vec = Vec3::ZERO; diff --git a/src/drivers/orbit.rs b/src/drivers/orbit.rs index f36e54b..e231990 100644 --- a/src/drivers/orbit.rs +++ b/src/drivers/orbit.rs @@ -15,9 +15,9 @@ impl Plugin for CCOrbit { fn build(&self, app: &mut App) { app.add_rig_component(CCOrbit) .add_state::() - .add_startup_system(setup_orbit.after(CCSetupLabel)) - .add_system(handle_mouse_scroll) - .add_system(update_orbit_camera); + .add_systems(Startup, setup_orbit.after(CCSetupLabel)) + .add_systems(Update, handle_mouse_scroll) + .add_systems(Update, update_orbit_camera); } } diff --git a/src/lib.rs b/src/lib.rs index 32153d1..a6f60f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,9 +3,9 @@ pub mod drivers; use bevy::{ prelude::{ - default, App, Camera, Commands, Component, - OrthographicProjection, Plugin, Query, Res, Resource, SystemSet, - Transform, Vec3, With, Camera3dBundle, Camera2dBundle, Update, Startup, IntoSystemConfigs, + default, App, Camera, Camera2dBundle, Camera3dBundle, Commands, Component, + IntoSystemConfigs, OrthographicProjection, Plugin, Query, Res, Resource, Startup, + SystemSet, Transform, Update, Vec3, With, }, render::camera::ScalingMode, }; @@ -30,7 +30,10 @@ impl Plugin for ConfigCam { player: Player::None, ..Default::default() }) - .add_systems(Startup, camera_setup.run_if(is_init_cameras).in_set(CCSetupLabel)) + .add_systems( + Startup, + camera_setup.run_if(is_init_cameras).in_set(CCSetupLabel), + ) .add_plugins(CCFpv) .add_plugins(CCOrbit) .add_systems(Update, change_driver_system) @@ -84,7 +87,7 @@ fn is_init_cameras(config: Res) -> bool { config.init_cameras } -fn camera_setup(mut commands: Commands, config: Res) { +fn camera_setup(mut commands: Commands, _config: Res) { commands.spawn(( MainCamera, PerspectiveCamera,