diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-02-10 22:13:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 22:13:28 +0100 |
commit | 69ddf2fd05dccbb2e802e72392f701a881eaca78 (patch) | |
tree | 4e1e60819b6062bf268f3c0c69128c083d5804a4 /core/object/class_db.cpp | |
parent | 2362c5806773aca4a728a3f50a9de0f568bdac73 (diff) | |
parent | 107b6f299cda3f8b63432930f19cdd9bc24fb6dc (diff) |
Merge pull request #55157 from pycbouh/control-inspector-reorg
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) { |