diff options
author | FireForge <67974470+fire-forge@users.noreply.github.com> | 2022-04-10 22:18:21 -0500 |
---|---|---|
committer | FireForge <67974470+fire-forge@users.noreply.github.com> | 2022-04-10 22:18:21 -0500 |
commit | 197be78bc558aa90413bd0420c24736a989e5f0e (patch) | |
tree | e5fb0f8d95c75c9d0d1c7b795b51c8f53d6b2811 /scene/resources | |
parent | 83d26737727f281afcb33f66fea5d09ed6c48d5a (diff) |
Fix Theme type group naming in the inspector
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/theme.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 373fbb94ea..feacc6dd5c 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -198,7 +198,15 @@ void Theme::_get_property_list(List<PropertyInfo> *p_list) const { // Sort and store properties. list.sort(); + String prev_type; for (const PropertyInfo &E : list) { + // Add groups for types so that their names are left unchanged in the inspector. + String current_type = E.name.get_slice("/", 0); + if (prev_type != current_type) { + p_list->push_back(PropertyInfo(Variant::NIL, current_type, PROPERTY_HINT_NONE, current_type + "/", PROPERTY_USAGE_GROUP)); + prev_type = current_type; + } + p_list->push_back(E); } } |