kitgit

tirbofish/dropbear · diff

6cfe509 · Thribhu K

feature: small feature, but implemented a eucalyptus-editor::features::ShouwComponentTypeIDInEditor crate.

Unverified

diff --git a/crates/eucalyptus-editor/Cargo.toml b/crates/eucalyptus-editor/Cargo.toml
index 19105ae..75971c9 100644
--- a/crates/eucalyptus-editor/Cargo.toml
+++ b/crates/eucalyptus-editor/Cargo.toml
@@ -54,6 +54,7 @@ ron.workspace = true
 rfd.workspace = true
 semver.workspace = true
 serde.workspace = true
+bitflags.workspace = true
 
 [target.'cfg(unix)'.dependencies]
 daemonize = "0.5.0"
diff --git a/crates/eucalyptus-editor/src/debug.rs b/crates/eucalyptus-editor/src/debug.rs
index 1cc0a2c..84a3379 100644
--- a/crates/eucalyptus-editor/src/debug.rs
+++ b/crates/eucalyptus-editor/src/debug.rs
@@ -37,5 +37,13 @@ pub(crate) fn show_menu_bar(ui: &mut Ui, signal: &mut Signal) {
             
             *signal = Signal::RequestNewWindow(window_data);
         }
+
+        if ui_debug.button("Show TypeID of components").clicked() {
+            if crate::features::is_enabled(crate::features::ShowComponentTypeIDInEditor) {
+                crate::features::disable(crate::features::ShowComponentTypeIDInEditor);
+            } else {
+                crate::features::enable(crate::features::ShowComponentTypeIDInEditor);
+            }
+        }
     });
 }
diff --git a/crates/eucalyptus-editor/src/editor/entity_list.rs b/crates/eucalyptus-editor/src/editor/entity_list.rs
index 63b42ba..72c0f63 100644
--- a/crates/eucalyptus-editor/src/editor/entity_list.rs
+++ b/crates/eucalyptus-editor/src/editor/entity_list.rs
@@ -90,12 +90,14 @@ impl<'a> EditorTabViewer<'a> {
                                 );
                             continue;
                         };
+                        let display_id = crate::features::is_enabled(crate::features::ShowComponentTypeIDInEditor);
+
                         let component_node_id =
                             cfg.component_node_id(entity, component_type_id as u64);
                         let display = registry
                             .get_descriptor_by_numeric_id(component_type_id)
-                            .map(|desc| format!("{} (id #{component_type_id})", desc.type_name))
-                            .unwrap_or_else(|| format!("Unknown (id #{component_type_id})"));
+                            .map(|desc| if display_id { format!("{} (id #{component_type_id})", desc.type_name) } else { desc.type_name.clone() })
+                            .unwrap_or_else(|| if display_id { format!("Unknown (id #{component_type_id})") } else { String::from("Unknown")});
 
                         let has_rigidbody = world.get::<&RigidBody>(entity).is_ok();

Large diffs are not rendered by default. Showing the first 50 of 69 lines. Show full diff