From 04b240584310b9e91b06c8e3e567208d3c89af6d Mon Sep 17 00:00:00 2001 From: FireForge <67974470+fire-forge@users.noreply.github.com> Date: Sun, 10 Apr 2022 22:18:21 -0500 Subject: [PATCH] Fix Theme type group naming in the inspector (cherry picked from commit 197be78bc558aa90413bd0420c24736a989e5f0e) --- scene/resources/theme.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 928ec2a2f..0656143ae 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -179,7 +179,15 @@ void Theme::_get_property_list(List *p_list) const { } list.sort(); + String prev_type; for (List::Element *E = list.front(); E; E = E->next()) { + // Add groups for types so that their names are left unchanged in the inspector. + String current_type = E->get().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->get()); } }