feat(bevy_components): added handling of wrong string for unit structs

* allows detection of more wrong values for components
This commit is contained in:
kaosat.dev 2024-03-06 14:36:08 +01:00
parent 253a76f2bc
commit 00695a18d8
2 changed files with 4 additions and 3 deletions

View File

@ -227,7 +227,7 @@ class OT_rename_component(Operator):
else:
self.report({'INFO'}, "Sucessfully renamed component")
# TODO: clear data after we are done
#clear data after we are done
self.original_name = ""
context.window_manager.bevy_component_rename_helper.original_name = ""

View File

@ -224,8 +224,9 @@ def property_group_value_from_custom_property_value(property_group, definition,
else:
pass
if len(value) > 2: #a unit struct should be two chars long :()
#print("struct with zero fields")
raise Exception("input string too big for a unit struct")
elif type_info == "Tuple":
custom_property_values = parse_tuplestruct_string(value, start_nesting=1 if len(nesting) == 1 else 1)