Formatting, clippy

This commit is contained in:
Danny McGee
2024-03-22 17:40:25 -04:00
parent 53f0a165e3
commit 04d72a6650
4 changed files with 33 additions and 22 deletions
+2 -1
View File
@@ -106,7 +106,8 @@ fn tag_scene_elements(
q_primitives: Query<&Handle<Mesh>>,
) {
for (ent, children) in q_scene_elements.iter() {
cmd.entity(ent).insert(Selectable).insert(PickableBundle::default());
cmd.entity(ent)
.insert((Selectable, PickableBundle::default()));
if let Some(children) = children {
for &ent_child in children
+13 -3
View File
@@ -17,14 +17,25 @@ use bevy::{
use serde_repr::{Deserialize_repr, Serialize_repr};
use space_editor::{
prelude::{EditorEvent, EditorPrefabPath, PrefabMarker},
space_prefab::{component::{GltfPrefab, SceneAutoChild}, editor_registry::EditorRegistryExt},
space_prefab::{
component::{GltfPrefab, SceneAutoChild},
editor_registry::EditorRegistryExt,
},
};
#[cfg(feature = "wasm")]
use wasm_bindgen::prelude::wasm_bindgen;
use wgpu::{TextureDescriptor, TextureUsages};
use crate::{
anim::timeline_animation::AnimationTarget, camera_controller::{CameraController, CameraControllerBundle}, change_tracking::{ChangeTracker, ChangeTrackingPlugin}, debug::DebugPoint, headless::{is_headless, is_not_headless, HeadlessSettings}, interaction::Selectable, is_editor, math::{Combinable, Extrema}, screenshot::ScreenCapture, MainCamera
anim::timeline_animation::AnimationTarget,
camera_controller::{CameraController, CameraControllerBundle},
change_tracking::{ChangeTracker, ChangeTrackingPlugin},
debug::DebugPoint,
headless::{is_headless, is_not_headless, HeadlessSettings},
is_editor,
math::{Combinable, Extrema},
screenshot::ScreenCapture,
MainCamera,
};
pub struct ScenePlugin;
@@ -103,7 +114,6 @@ impl Plugin for ScenePlugin {
);
app.editor_registry::<SceneElement>();
// app.editor_registry::<Selectable>();
}
}
+2 -5
View File
@@ -27,11 +27,8 @@ fn read_command_system(mut commands: Commands, mut change_event: EventWriter<New
return;
};
let mut new_entity = commands.spawn((
SpatialBundle::default(),
PrefabMarker,
SceneElement::Mesh,
));
let mut new_entity =
commands.spawn((SpatialBundle::default(), PrefabMarker, SceneElement::Mesh));
match cmd {
BlockingCommand::Cube => {
+16 -13
View File
@@ -1,7 +1,11 @@
use std::{marker::PhantomData, sync::Arc};
use bevy::{
ecs::world::unsafe_world_cell::UnsafeWorldCell, prelude::*, reflect::{serde::ReflectSerializer, GetTypeRegistration}, transform::commands, utils::HashMap, window::PrimaryWindow
ecs::world::unsafe_world_cell::UnsafeWorldCell,
prelude::*,
reflect::{serde::ReflectSerializer, GetTypeRegistration},
utils::HashMap,
window::PrimaryWindow,
};
use serde::{Deserialize, Serialize};
use serde_json::{self, json, Map as JsonMap, Value as JsonValue};
@@ -10,7 +14,9 @@ use space_editor::{
editor_tab::{EditorTab, EditorTabName},
EditorUiAppExt,
},
space_prefab::{component::MeshPrimitivePrefab, editor_registry::EditorRegistryExt, save::SaveState},
space_prefab::{
component::MeshPrimitivePrefab, editor_registry::EditorRegistryExt, save::SaveState,
},
};
use wasm_bindgen::prelude::*;
@@ -62,7 +68,6 @@ impl Plugin for InspectorPlugin {
//register standart material
{
app.editor_registry::<ShortMaterial>()
.add_event::<UpdateInspect<Handle<StandardMaterial>>>()
.add_systems(
@@ -83,7 +88,9 @@ impl Plugin for InspectorPlugin {
app.add_systems(
OnEnter(SaveState::Save),
(create_short_materials, apply_deferred).chain().before(space_editor::space_prefab::sub_scene::prepare_auto_scene)
(create_short_materials, apply_deferred)
.chain()
.before(space_editor::space_prefab::sub_scene::prepare_auto_scene),
);
app.add_systems(PostUpdate, apply_short_materials);
@@ -121,10 +128,8 @@ impl Plugin for InspectorPlugin {
}
}
fn create_short_materials(
mut commands : Commands,
mut commands: Commands,
q_mats: Query<(Entity, &Handle<StandardMaterial>)>,
materials: Res<Assets<StandardMaterial>>,
) {
@@ -136,12 +141,12 @@ fn create_short_materials(
}
fn apply_short_materials(
mut commands : Commands,
mut commands: Commands,
q_mats: Query<(Entity, &Handle<StandardMaterial>, &ShortMaterial)>,
mut materials: ResMut<Assets<StandardMaterial>>,)
{
mut materials: ResMut<Assets<StandardMaterial>>,
) {
for (entity, handle, short) in q_mats.iter() {
let Some(mut material) = materials.get_mut(handle) else {
let Some(material) = materials.get_mut(handle) else {
continue;
};
@@ -154,7 +159,6 @@ fn apply_short_materials(
}
}
#[derive(Resource, Default)]
struct InspectGetters {
getters: HashMap<
@@ -595,7 +599,6 @@ impl ShortMaterial {
}
}
fn serialize_standart_materal(
r_selection: Option<Res<Selection>>,
q_m: Query<&Handle<StandardMaterial>>,