Skip to content

Commit

Permalink
fix-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed Jun 22, 2024
1 parent 16e4203 commit 1916127
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 48 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/editor_core/src/selected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::{
};

#[cfg(feature = "bevy_mod_outline")]
use bevy_mod_outline::{OutlinePlugin, OutlineVolume, OutlineBundle};
use bevy_mod_outline::{OutlineBundle, OutlinePlugin, OutlineVolume};

/// A marker for editor selected entities
#[derive(Component, Default, Clone)]
Expand Down Expand Up @@ -60,7 +60,6 @@ fn selected_entity_wireframe_update(
del_wireframe: Query<Entity, (With<OutlineVolume>, Without<Selected>)>,
need_wireframe: Query<Entity, (Without<OutlineVolume>, With<Selected>)>,
) {

for e in del_wireframe.iter() {
cmds.entity(e).remove::<OutlineBundle>();
}
Expand Down
1 change: 0 additions & 1 deletion crates/editor_ui/src/camera_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub struct CameraViewTabPlugin;
impl Plugin for CameraViewTabPlugin {
#[cfg(not(tarpaulin_include))]
fn build(&self, app: &mut App) {

app.editor_tab_by_trait(CameraViewTab::default());
app.add_systems(
PreUpdate,
Expand Down
58 changes: 16 additions & 42 deletions crates/editor_ui/src/meshless_visualizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,23 @@ pub struct MeshlessVisualizerPlugin;
impl Plugin for MeshlessVisualizerPlugin {
#[cfg(not(tarpaulin_include))]
fn build(&self, app: &mut App) {
use bevy_asset_loader::prelude::*;

use toast::ToastMessage;

if std::fs::metadata("assets/icons/").is_ok() {
app.add_loading_state(
LoadingState::new(EditorState::Loading)
.continue_to_state(EditorState::Editor)
.load_collection::<EditorIconAssets>()
.register_dynamic_asset_collection::<EditorIconAssetCollection>()
.with_dynamic_assets_file::<EditorIconAssetCollection>(
"icons/editor.icons.ron",
),
app.add_systems(OnEnter(EditorState::Editor), register_assets)
.add_systems(
Startup,
|mut next_editor_state: ResMut<NextState<EditorState>>| {
next_editor_state.set(EditorState::Editor);
},
)
.add_plugins(RonAssetPlugin::<EditorIconAssetCollection>::new(&[
"icons.ron",
]))
} else {
app.world.send_event(ToastMessage::new(
"Failed to dynamic load assets. Loading defaults from memory",
ToastKind::Error,
));
error!("Failed to dynamic load assets. Loading defaults from memory");
app.add_systems(OnEnter(EditorState::Editor), register_assets)
.add_systems(
Startup,
|mut next_editor_state: ResMut<NextState<EditorState>>| {
next_editor_state.set(EditorState::Editor);
},
)
}
.insert_resource(RaycastBackendSettings {
raycast_visibility: RaycastVisibility::Ignore,
..Default::default()
})
.add_plugins(BillboardPlugin)
.add_systems(
Update,
(visualize_meshless, visualize_custom_meshless)
.run_if(resource_exists::<EditorIconAssets>)
.in_set(EditorShowSet::Show),
)
.editor_registry::<CustomMeshless>();
.insert_resource(RaycastBackendSettings {
raycast_visibility: RaycastVisibility::Ignore,
..Default::default()
})
.add_plugins(BillboardPlugin)
.add_systems(
Update,
(visualize_meshless, visualize_custom_meshless).in_set(EditorShowSet::Show),
)
.editor_registry::<CustomMeshless>();
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/bevy_xpbd_plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ description = "Space XPBD plugin for space_editor crate"
[dependencies]
bevy.workspace = true
space_editor_ui.workspace = true
space_shared.workspace = true
bevy_xpbd_3d = { workspace = true, features = ["3d", "f32", "collider-from-mesh", "debug-plugin", "default-collider", "parry-f32"] }
bevy-inspector-egui.workspace = true
workspace-hakari = { version = "0.1", path = "../../workspace-hakari" }
Expand Down
14 changes: 11 additions & 3 deletions modules/bevy_xpbd_plugin/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use space_editor_ui::{
settings::RegisterSettingsBlockExt,
ui_plugin::UiSystemSet,
};
use space_shared::EditorShowSet;

use crate::{
collider::{self, ColliderPart, ColliderPrefabCompound, ColliderPrimitive},
Expand Down Expand Up @@ -65,7 +66,12 @@ impl Plugin for BevyXpbdPlugin {
force_rigidbody_type_change_in_editor,
);
app.add_systems(OnEnter(EditorState::Game), force_rigidbody_type_change);
app.add_systems(Update, transform_changed.after(UiSystemSet).in_set(EditorSet::EditorAndGame));
app.add_systems(
Update,
transform_changed
.after(UiSystemSet)
.in_set(EditorShowSet::Show),
);
// app.add_systems(
// Update,
// (sync_position_spawn, late_sync_position_spawn).in_set(EditorSet::EditorAndGame).after(UiSystemSet),
Expand Down Expand Up @@ -95,13 +101,15 @@ impl Plugin for BevyXpbdPlugin {
}
}


fn transform_changed(
mut commands: Commands,
query: Query<(Entity, &GlobalTransform), Changed<GlobalTransform>>,
) {
for (e, tr) in query.iter() {
commands.entity(e).insert((Position(tr.translation()), Rotation(tr.compute_transform().rotation)));
commands.entity(e).insert((
Position(tr.translation()),
Rotation(tr.compute_transform().rotation),
));
}
}

Expand Down

0 comments on commit 1916127

Please sign in to comment.