Custom entity fields, @Hide for entity member UI, queue

This commit is contained in:
2024-12-16 23:37:12 +01:00
parent 36c6bc5fe7
commit 07dbdcfe2c
5 changed files with 77 additions and 5 deletions

View File

@@ -81,9 +81,47 @@ should_serialize :: (type: *Type_Info_Struct, member: Type_Info_Struct_Member) -
return true;
}
should_make_ui :: (type: *Type_Info_Struct, member: Type_Info_Struct_Member) -> bool {
for member.notes {
if to_lower_copy_new(it,, allocator = temp) == "hide" return false;
}
if type!= null {
if type.name == {
case "Vector2"; {
if member.name == {
case "x"; #through;
case "y"; #through;
case; return false;
}
}
case "Vector3"; {
if member.name == {
case "x"; #through;
case "y"; #through;
case "z"; return true;
case; return false;
}
}
case "Vector4"; #through;
case "Quaternion"; {
if member.name == {
case "x"; #through;
case "y"; #through;
case "z"; #through;
case "w"; return true;
case; return false;
}
}
}
}
return true;
}
generate_member_ui :: (type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
for type.members {
if should_serialize(type, it) {
if should_make_ui(type, it) && should_serialize(type, it) {
new_path : string;
if path.count == 0 {
new_path = it.name;