kitgit

tirbofish/dropbear · commit

6cfe5091fc243d5b25e2590556db2fd489407175

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

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-02-20 04:34

view full diff

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();
                         let has_collider = world.get::<&ColliderGroup>(entity).is_ok();
diff --git a/crates/eucalyptus-editor/src/lib.rs b/crates/eucalyptus-editor/src/lib.rs
index 6a9fa86..f1a7704 100644
--- a/crates/eucalyptus-editor/src/lib.rs
+++ b/crates/eucalyptus-editor/src/lib.rs
@@ -11,4 +11,10 @@ pub mod utils;
 pub mod about;
 pub mod process;
 pub mod physics;
-pub use redback_runtime as runtime;
\ No newline at end of file
+pub use redback_runtime as runtime;
+
+dropbear_engine::features! {
+    pub mod features {
+        const ShowComponentTypeIDInEditor = 0b00000001
+    }
+}
\ No newline at end of file