summaryrefslogtreecommitdiff
path: root/engine/src/ui/view
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-08-31 06:26:07 +0200
committerHampusM <hampus@hampusmat.com>2026-08-31 06:26:07 +0200
commit47504e744398d16c013b976aade043fe5372e31e (patch)
treece88101e0f97be9fa6cd65acf76c6e993180a3ae /engine/src/ui/view
parent0a08f7da89b150aa8f6f5a9e7a3514585801b64c (diff)
fix(engine): make soles not addable to entities in world ui view
Diffstat (limited to 'engine/src/ui/view')
-rw-r--r--engine/src/ui/view/world.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/engine/src/ui/view/world.rs b/engine/src/ui/view/world.rs
index ff4c13a..143ff84 100644
--- a/engine/src/ui/view/world.rs
+++ b/engine/src/ui/view/world.rs
@@ -608,7 +608,9 @@ fn enter_add_component_popup_state(
.query::<(&ComponentInfo,)>()
.iter_with_euids()
.map(|(id, (component_info,))| {
- let user_creatable = if component_info.type_reflection.is_none() {
+ let user_creatable = if component_info.is_sole {
+ ComponentUserCreatable::No { reason: "is a sole" }
+ } else if component_info.type_reflection.is_none() {
ComponentUserCreatable::No { reason: "no type reflection" }
} else if component_info
.type_reflection
@@ -796,10 +798,11 @@ fn show_add_component_popup(
{
actions.add_components(
add_component_popup_state.target_entity_id,
- [ComponentParts::builder()
- .name(new_component_info.name)
- .type_reflection(new_component_info.type_reflection)
- .build_with_any_data(new_component_id, new_component_data)],
+ [ComponentParts::from_component_info(
+ &new_component_info,
+ new_component_id,
+ new_component_data,
+ )],
);
return true;