From 04befe5ab0b9878addeae7653d41ef3dabeca820 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Mon, 28 Aug 2023 20:21:54 -0700 Subject: [PATCH] saving my place before reworking animation and camera buttons --- assets/models/inspect.blend | 4 ++-- assets/models/inspect.blend1 | 4 ++-- assets/models/inspect.glb | 4 ++-- assets/models/materials.blend | 4 ++-- assets/models/materials.blend1 | 4 ++-- bin/editor.rs | 42 ++++++++-------------------------- src/ui.rs | 2 +- 7 files changed, 20 insertions(+), 44 deletions(-) diff --git a/assets/models/inspect.blend b/assets/models/inspect.blend index 01c24a2..f55e80f 100644 --- a/assets/models/inspect.blend +++ b/assets/models/inspect.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d1f234d6ce4b9a34ce38f52d40492533c6e5661d6ba090200ef07e6720c639c -size 1419860 +oid sha256:93493487e935398def827d4f945e671178b25408e1477c8b9adca177e5969080 +size 1979400 diff --git a/assets/models/inspect.blend1 b/assets/models/inspect.blend1 index ae1dc7d..c62a66f 100644 --- a/assets/models/inspect.blend1 +++ b/assets/models/inspect.blend1 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6e8a25df7b24c60bf7ac71fb6c7ecea73fdfde51371e10c4e58fcd9889d503d5 -size 1395092 +oid sha256:af12822c2d103ec0ebf53cf42e06a9039fc7c150374cd7370aa48a1de6d8960d +size 1979400 diff --git a/assets/models/inspect.glb b/assets/models/inspect.glb index f32df3a..f3aa8ce 100644 --- a/assets/models/inspect.glb +++ b/assets/models/inspect.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:82deeb60e595bca1e3f3a2ece0ca22e50d433756c1848952bdf1df9039008bc7 -size 488980 +oid sha256:549b7519ba17cd24a010d604b475f9b7b831292c4e0ffda9ad009f9d1cd9b607 +size 1136928 diff --git a/assets/models/materials.blend b/assets/models/materials.blend index 25ad295..9dfa649 100644 --- a/assets/models/materials.blend +++ b/assets/models/materials.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1e90293cb3ed77a245603b9f1ef74514973a9472fa30a1339af28f4d9cd2e8b6 -size 1320856 +oid sha256:49b4c75ff7a022cb5893fb01d7a162c0bc11e83797315408d86a69775b759869 +size 1318832 diff --git a/assets/models/materials.blend1 b/assets/models/materials.blend1 index 144b13d..8f19b7d 100644 --- a/assets/models/materials.blend1 +++ b/assets/models/materials.blend1 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:034f798a326c865905ef61c3099a44bf8e4d541d34246be2a02b0c28bf9d7bd4 -size 1320856 +oid sha256:a85ef985fb7450a815b3cd7397d10a6492153b03c950c998fa77f9a85805ef7c +size 1318832 diff --git a/bin/editor.rs b/bin/editor.rs index ad4c7fb..9404d0e 100644 --- a/bin/editor.rs +++ b/bin/editor.rs @@ -9,7 +9,13 @@ // * Easy despawn when de-selecting gltf // // TODO: -// * (easy) Play all animations +// * Disable auto start/load +// * Make GLTF nested menu +// * Better handle hide/close monologue +// * (hard) Harden Active Camera +// * (medium) Select Font -> "Default Font" Resource +// * (medium) Pre-compute animation target entities +// * (medium) Animation buttons only visible when playable // * (easy) Clear button to wipe spawned scene // * (brutal) export level // * (hard) import level @@ -224,7 +230,7 @@ fn initialize_ui(mut commands: Commands) { content_containers.push(spawn_tab_container::( "Scene", parent, - ui::Select::Multi, + ui::Select::Single, )); content_containers.push(spawn_tab_container::( "Animation", @@ -553,22 +559,6 @@ mod assets { commands.entity(entity).despawn_recursive(); } } - - pub fn has_extensions( - server: &AssetServer, - handle: Handle, - extensions: &[&'static str], - ) -> bool { - if let Some(asset_path) = server.get_handle_path(handle.clone()) { - if let Some(extension) = asset_path.path().extension() { - extensions.iter().any(|&check| check == extension) - } else { - false - } - } else { - false - } - } } use gltf::*; @@ -764,8 +754,6 @@ mod scenes { current: Query<(Entity, &ui::TargetAsset)>, ) { events.iter().for_each(|event| { - let empty = current.iter().len() == 0; - match event { CustomAssetEvent::Add { name, handle } => { info!("Asset loading! {:?}({:?})", name, handle); @@ -779,10 +767,6 @@ mod scenes { name.clone(), None, ); - // If this is the first scene being added, set it as active - if empty { - commands.entity(e).insert(ui::Active); - } } CustomAssetEvent::Remove { handle } => { destroy_asset_button( @@ -1151,10 +1135,8 @@ mod monologues { }); } - // TODO(BUG): Better handle hide/close monologue pub fn show_preview_text( added: Query, Added)>, - mut removed: RemovedComponents, monologue_handles: Query<&ui::TargetAsset>, monologues: Res>, container: Query>, @@ -1246,8 +1228,6 @@ mod cameras { destroy_entity_button(¤t, &mut commands, &ui::TargetEntity { entity }); }); added.iter_mut().for_each(|(entity, mut camera, name)| { - let empty = current.iter().len() == 0; - info!("Camera added {:?} {:?}", entity, name); let e = create_entity_button( &widget, @@ -1255,11 +1235,7 @@ mod cameras { ui::TargetEntity { entity }, name.as_str().into(), ); - if empty { - commands.entity(e).insert(ui::Active); - } else { - camera.is_active = false; - } + camera.is_active = false; }); } diff --git a/src/ui.rs b/src/ui.rs index 20a5730..3695360 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -616,7 +616,7 @@ pub mod alert { parent.spawn(( TitleBarBase::new(color).bundle(), Title { - text: "Alert".into(), + text: "Heads up!".into(), ..default() }, Close {