diff options
author | Yuri Sizov <yuris@humnom.net> | 2021-11-08 23:53:41 +0300 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2022-02-10 20:29:34 +0300 |
commit | 107b6f299cda3f8b63432930f19cdd9bc24fb6dc (patch) | |
tree | 24026b11ed93dea43d86c16544e2ac40ec030517 /core/object/class_db.cpp | |
parent | 242c636a63ac2d8b002ace37388dce9273a9048a (diff) |
Reorganize inspector layout workflow for Control nodes
Diffstat (limited to 'core/object/class_db.cpp')
-rw-r--r-- | core/object/class_db.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 3df4db9c5e..c29316c089 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -1007,20 +1007,30 @@ bool ClassDB::get_signal(const StringName &p_class, const StringName &p_signal, return false; } -void ClassDB::add_property_group(const StringName &p_class, const String &p_name, const String &p_prefix) { +void ClassDB::add_property_group(const StringName &p_class, const String &p_name, const String &p_prefix, int p_indent_depth) { OBJTYPE_WLOCK; ClassInfo *type = classes.getptr(p_class); ERR_FAIL_COND(!type); - type->property_list.push_back(PropertyInfo(Variant::NIL, p_name, PROPERTY_HINT_NONE, p_prefix, PROPERTY_USAGE_GROUP)); + String prefix = p_prefix; + if (p_indent_depth > 0) { + prefix = vformat("%s,%d", p_prefix, p_indent_depth); + } + + type->property_list.push_back(PropertyInfo(Variant::NIL, p_name, PROPERTY_HINT_NONE, prefix, PROPERTY_USAGE_GROUP)); } -void ClassDB::add_property_subgroup(const StringName &p_class, const String &p_name, const String &p_prefix) { +void ClassDB::add_property_subgroup(const StringName &p_class, const String &p_name, const String &p_prefix, int p_indent_depth) { OBJTYPE_WLOCK; ClassInfo *type = classes.getptr(p_class); ERR_FAIL_COND(!type); - type->property_list.push_back(PropertyInfo(Variant::NIL, p_name, PROPERTY_HINT_NONE, p_prefix, PROPERTY_USAGE_SUBGROUP)); + String prefix = p_prefix; + if (p_indent_depth > 0) { + prefix = vformat("%s,%d", p_prefix, p_indent_depth); + } + + type->property_list.push_back(PropertyInfo(Variant::NIL, p_name, PROPERTY_HINT_NONE, prefix, PROPERTY_USAGE_SUBGROUP)); } void ClassDB::add_property_array_count(const StringName &p_class, const String &p_label, const StringName &p_count_property, const StringName &p_count_setter, const StringName &p_count_getter, const String &p_array_element_prefix, uint32_t p_count_usage) { |