From 8e9ae734c8c08609e22b09227d73778cadccd404 Mon Sep 17 00:00:00 2001 From: Julia Naomi Date: Sun, 9 Jun 2024 13:18:45 -0400 Subject: [PATCH] fmt --- crates/editor_core/src/selected.rs | 5 +---- crates/editor_ui/src/camera_view.rs | 5 ++++- crates/editor_ui/src/lib.rs | 17 ++++++++++------- crates/editor_ui/src/meshless_visualizer.rs | 4 +++- crates/editor_ui/src/tools/gizmo.rs | 6 +++--- crates/editor_ui/src/ui_plugin.rs | 13 +++---------- modules/bevy_xpbd_plugin/src/registry.rs | 7 +++++-- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/crates/editor_core/src/selected.rs b/crates/editor_core/src/selected.rs index e2cfb06d..62991f93 100644 --- a/crates/editor_core/src/selected.rs +++ b/crates/editor_core/src/selected.rs @@ -15,10 +15,7 @@ impl Plugin for SelectedPlugin { if !app.is_plugin_added::() { app.add_plugins(WireframePlugin); } - app.add_systems( - Update, - selected_entity_wireframe_update, - ); + app.add_systems(Update, selected_entity_wireframe_update); // app.add_systems(OnEnter(ShowEditorUi::Hide), clear_wireframes); } } diff --git a/crates/editor_ui/src/camera_view.rs b/crates/editor_ui/src/camera_view.rs index 9b59e9e9..9ef7c7c2 100644 --- a/crates/editor_ui/src/camera_view.rs +++ b/crates/editor_ui/src/camera_view.rs @@ -30,7 +30,10 @@ pub struct CameraViewTabPlugin; impl Plugin for CameraViewTabPlugin { fn build(&self, app: &mut App) { app.editor_tab_by_trait(EditorTabName::CameraView, CameraViewTab::default()); - app.add_systems(PreUpdate, set_camera_viewport.run_if(in_state(ShowEditorUi::Show))); + app.add_systems( + PreUpdate, + set_camera_viewport.run_if(in_state(ShowEditorUi::Show)), + ); app.add_systems(OnEnter(ShowEditorUi::Hide), clean_camera_view_tab); } } diff --git a/crates/editor_ui/src/lib.rs b/crates/editor_ui/src/lib.rs index bc03786a..3aa1df73 100644 --- a/crates/editor_ui/src/lib.rs +++ b/crates/editor_ui/src/lib.rs @@ -94,8 +94,7 @@ use space_prefab::prelude::*; use space_shared::{ ext::bevy_inspector_egui::{quick::WorldInspectorPlugin, DefaultInspectorConfigPlugin}, toast::ToastMessage, - EditorCameraMarker, EditorSet, EditorState, PrefabMarker, PrefabMemoryCache, - EditorShowSet + EditorCameraMarker, EditorSet, EditorShowSet, EditorState, PrefabMarker, PrefabMemoryCache, }; use space_undo::{SyncUndoMarkersPlugin, UndoPlugin, UndoSet}; use ui_registration::BundleReg; @@ -167,8 +166,7 @@ impl PluginGroup for EditorPluginGroup { .add(selection::EditorPickingPlugin) .add(bevy_debug_grid::DebugGridPlugin::without_floor_grid()) .add( - WorldInspectorPlugin::default() - .run_if(input_toggle_active(false, KeyCode::Escape)), + WorldInspectorPlugin::default().run_if(input_toggle_active(false, KeyCode::Escape)), ) .add(EditorGizmoConfigPlugin) } @@ -193,7 +191,10 @@ impl Plugin for EditorSetsPlugin { PreUpdate, EditorSet::OnlyEditor.run_if(in_state(EditorState::Game)), ); - app.configure_sets(Update, EditorSet::OnlyGame.run_if(in_state(EditorState::Game))); + app.configure_sets( + Update, + EditorSet::OnlyGame.run_if(in_state(EditorState::Game)), + ); app.configure_sets( PostUpdate, EditorSet::OnlyGame.run_if(in_state(EditorState::Game)), @@ -212,8 +213,10 @@ impl Plugin for EditorSetsPlugin { EditorSet::OnlyEditor.run_if(in_state(EditorState::Editor)), ); - - app.configure_sets(PreUpdate, EditorShowSet::Show.run_if(in_state(ShowEditorUi::Show))); + app.configure_sets( + PreUpdate, + EditorShowSet::Show.run_if(in_state(ShowEditorUi::Show)), + ); } } diff --git a/crates/editor_ui/src/meshless_visualizer.rs b/crates/editor_ui/src/meshless_visualizer.rs index 498d1f8d..8636ec68 100644 --- a/crates/editor_ui/src/meshless_visualizer.rs +++ b/crates/editor_ui/src/meshless_visualizer.rs @@ -61,7 +61,9 @@ impl Plugin for MeshlessVisualizerPlugin { .add_plugins(BillboardPlugin) .add_systems( Update, - (visualize_meshless, visualize_custom_meshless).run_if(resource_exists::).in_set(EditorShowSet::Show), + (visualize_meshless, visualize_custom_meshless) + .run_if(resource_exists::) + .in_set(EditorShowSet::Show), ) .editor_registry::(); } diff --git a/crates/editor_ui/src/tools/gizmo.rs b/crates/editor_ui/src/tools/gizmo.rs index dad5c0e2..55856855 100644 --- a/crates/editor_ui/src/tools/gizmo.rs +++ b/crates/editor_ui/src/tools/gizmo.rs @@ -164,9 +164,9 @@ impl EditorTool for GizmoTool { }; if ref_cam_state.is_active { (*ref_tr, ref_cam.clone()) //we have active editor camera - } else { //if we havent, so its game mode and we can try to find active game camera - let mut cam_query = - world.query::<(&GlobalTransform, &Projection, &Camera)>(); + } else { + //if we havent, so its game mode and we can try to find active game camera + let mut cam_query = world.query::<(&GlobalTransform, &Projection, &Camera)>(); let mut ret = None; for (ref_tr, ref_cam, ref_cam_state) in cam_query.iter(world) { if ref_cam_state.is_active { diff --git a/crates/editor_ui/src/ui_plugin.rs b/crates/editor_ui/src/ui_plugin.rs index ebf8aff8..1e8b98ef 100644 --- a/crates/editor_ui/src/ui_plugin.rs +++ b/crates/editor_ui/src/ui_plugin.rs @@ -105,11 +105,7 @@ impl Plugin for EditorUiCore { fn build(&self, app: &mut App) { app.init_state::(); - app.configure_sets( - Update, - UiSystemSet - .in_set(EditorShowSet::Show), - ); + app.configure_sets(Update, UiSystemSet.in_set(EditorShowSet::Show)); app.init_resource::(); app.init_resource::(); app.add_systems( @@ -132,7 +128,7 @@ impl Plugin for EditorUiCore { .run_if(has_window_changed) .in_set(UiSystemSet), ); - + app.add_systems(OnEnter(ShowEditorUi::Hide), reset_camera_viewport); app.editor_tab_by_trait(EditorTabName::GameView, GameViewTab::default()); @@ -177,10 +173,7 @@ impl Plugin for EditorUiCore { ); if self.disable_no_editor_cams { - app.add_systems( - Update, - disable_no_editor_cams.in_set(EditorSet::OnlyEditor), - ); + app.add_systems(Update, disable_no_editor_cams.in_set(EditorSet::OnlyEditor)); app.add_systems(OnEnter(EditorState::Editor), change_camera_in_editor); } diff --git a/modules/bevy_xpbd_plugin/src/registry.rs b/modules/bevy_xpbd_plugin/src/registry.rs index a1faf4a4..ac6ad4b6 100644 --- a/modules/bevy_xpbd_plugin/src/registry.rs +++ b/modules/bevy_xpbd_plugin/src/registry.rs @@ -3,7 +3,8 @@ use bevy_xpbd_3d::prelude::*; use collider::ColliderPrefab; use space_editor_ui::{ prelude::{EditorRegistryExt, EditorState, PrefabSet}, - settings::RegisterSettingsBlockExt, ui_plugin::UiSystemSet, + settings::RegisterSettingsBlockExt, + ui_plugin::UiSystemSet, }; use crate::{ @@ -66,7 +67,9 @@ impl Plugin for BevyXpbdPlugin { app.add_systems(OnEnter(EditorState::Game), force_rigidbody_type_change); app.add_systems( Update, - (sync_position_spawn, late_sync_position_spawn).run_if(in_state(EditorState::Editor)).after(UiSystemSet), + (sync_position_spawn, late_sync_position_spawn) + .run_if(in_state(EditorState::Editor)) + .after(UiSystemSet), ); if app.is_plugin_added::() {