Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed Jun 9, 2024
1 parent 693c7a7 commit 8e9ae73
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
5 changes: 1 addition & 4 deletions crates/editor_core/src/selected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ impl Plugin for SelectedPlugin {
if !app.is_plugin_added::<WireframePlugin>() {
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);

Check warning on line 19 in crates/editor_core/src/selected.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_core/src/selected.rs#L18-L19

Added lines #L18 - L19 were not covered by tests
}
}
Expand Down
5 changes: 4 additions & 1 deletion crates/editor_ui/src/camera_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 37 in crates/editor_ui/src/camera_view.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/camera_view.rs#L33-L37

Added lines #L33 - L37 were not covered by tests
}
}
Expand Down
17 changes: 10 additions & 7 deletions crates/editor_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)),

Check warning on line 169 in crates/editor_ui/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/lib.rs#L169

Added line #L169 was not covered by tests
)
.add(EditorGizmoConfigPlugin)
}
Expand All @@ -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)),

Check warning on line 196 in crates/editor_ui/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/lib.rs#L192-L196

Added lines #L192 - L196 were not covered by tests
);
app.configure_sets(
PostUpdate,
EditorSet::OnlyGame.run_if(in_state(EditorState::Game)),

Check warning on line 200 in crates/editor_ui/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/lib.rs#L200

Added line #L200 was not covered by tests
Expand All @@ -212,8 +213,10 @@ impl Plugin for EditorSetsPlugin {
EditorSet::OnlyEditor.run_if(in_state(EditorState::Editor)),

Check warning on line 213 in crates/editor_ui/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/lib.rs#L213

Added line #L213 was not covered by tests
);


app.configure_sets(PreUpdate, EditorShowSet::Show.run_if(in_state(ShowEditorUi::Show)));
app.configure_sets(
PreUpdate,
EditorShowSet::Show.run_if(in_state(ShowEditorUi::Show)),

Check warning on line 218 in crates/editor_ui/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/lib.rs#L217-L218

Added lines #L217 - L218 were not covered by tests
);
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/editor_ui/src/meshless_visualizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ impl Plugin for MeshlessVisualizerPlugin {
.add_plugins(BillboardPlugin)
.add_systems(
Update,
(visualize_meshless, visualize_custom_meshless).run_if(resource_exists::<EditorIconAssets>).in_set(EditorShowSet::Show),
(visualize_meshless, visualize_custom_meshless)
.run_if(resource_exists::<EditorIconAssets>)
.in_set(EditorShowSet::Show),

Check warning on line 66 in crates/editor_ui/src/meshless_visualizer.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/meshless_visualizer.rs#L64-L66

Added lines #L64 - L66 were not covered by tests
)
.editor_registry::<CustomMeshless>();
}
Expand Down
6 changes: 3 additions & 3 deletions crates/editor_ui/src/tools/gizmo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ impl EditorTool for GizmoTool {
};
if ref_cam_state.is_active {
(*ref_tr, ref_cam.clone()) //we have active editor camera

Check warning on line 166 in crates/editor_ui/src/tools/gizmo.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/tools/gizmo.rs#L165-L166

Added lines #L165 - L166 were not covered by tests
} 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 {
Expand Down
13 changes: 3 additions & 10 deletions crates/editor_ui/src/ui_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ impl Plugin for EditorUiCore {
fn build(&self, app: &mut App) {
app.init_state::<ShowEditorUi>();

app.configure_sets(
Update,
UiSystemSet
.in_set(EditorShowSet::Show),
);
app.configure_sets(Update, UiSystemSet.in_set(EditorShowSet::Show));

Check warning on line 108 in crates/editor_ui/src/ui_plugin.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/ui_plugin.rs#L108

Added line #L108 was not covered by tests
app.init_resource::<EditorUi>();
app.init_resource::<ScheduleEditorTabStorage>();
app.add_systems(
Expand All @@ -132,7 +128,7 @@ impl Plugin for EditorUiCore {
.run_if(has_window_changed)
.in_set(UiSystemSet),
);

Check warning on line 131 in crates/editor_ui/src/ui_plugin.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/ui_plugin.rs#L131

Added line #L131 was not covered by tests
app.add_systems(OnEnter(ShowEditorUi::Hide), reset_camera_viewport);
app.editor_tab_by_trait(EditorTabName::GameView, GameViewTab::default());

Expand Down Expand Up @@ -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));

Check warning on line 176 in crates/editor_ui/src/ui_plugin.rs

View check run for this annotation

Codecov / codecov/patch

crates/editor_ui/src/ui_plugin.rs#L176

Added line #L176 was not covered by tests

app.add_systems(OnEnter(EditorState::Editor), change_camera_in_editor);
}
Expand Down
7 changes: 5 additions & 2 deletions modules/bevy_xpbd_plugin/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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),

Check warning on line 72 in modules/bevy_xpbd_plugin/src/registry.rs

View check run for this annotation

Codecov / codecov/patch

modules/bevy_xpbd_plugin/src/registry.rs#L70-L72

Added lines #L70 - L72 were not covered by tests
);

if app.is_plugin_added::<space_editor_ui::ui_plugin::EditorUiCore>() {
Expand Down

0 comments on commit 8e9ae73

Please sign in to comment.