tirbofish/dropbear · diff
feature: small feature, but implemented a eucalyptus-editor::features::ShouwComponentTypeIDInEditor crate.
Signature present but could not be verified.
Unverified
@@ -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" @@ -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); + } + } }); } @@ -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(); @@ -11,4 +11,10 @@ pub mod utils; pub mod about; pub mod process; pub mod physics; -pub use redback_runtime as runtime; +pub use redback_runtime as runtime; + +dropbear_engine::features! { + pub mod features { + const ShowComponentTypeIDInEditor = 0b00000001 + } +}