Skip to content

Commit

Permalink
register InspectorEguiImpl for Uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobhellermann committed Jan 26, 2025
1 parent f5042b6 commit f66e49c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy-inspector-egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ smallvec = "1.10"

fuzzy-matcher = "0.3.7"
disqualified = "1.0.0"
uuid = "1.11.0"

[dev-dependencies]
bevy = { version = "0.15.0", default-features = false, features = [
Expand Down
10 changes: 10 additions & 0 deletions crates/bevy-inspector-egui/src/inspector_egui_impls/bevy_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ use crate::{

use super::InspectorPrimitive;

impl InspectorPrimitive for uuid::Uuid {
fn ui(&mut self, ui: &mut egui::Ui, _: &dyn Any, _: egui::Id, _: InspectorUi<'_, '_>) -> bool {
ui.label(self.to_string());
false
}
fn ui_readonly(&self, ui: &mut egui::Ui, _: &dyn Any, _: egui::Id, _: InspectorUi<'_, '_>) {
ui.label(self.to_string());
}
}

impl InspectorPrimitive for Entity {
fn ui(
&mut self,
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy-inspector-egui/src/inspector_egui_impls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ pub fn register_bevy_impls(type_registry: &mut TypeRegistry) {
{
add_of_with_many::<bevy_asset::Handle<bevy_image::Image>>(type_registry, many_unimplemented::<bevy_asset::Handle<bevy_image::Image>>);
}

add::<uuid::Uuid>(type_registry);
}

pub(crate) fn change_slider<T>(
Expand Down

0 comments on commit f66e49c

Please sign in to comment.