From 2cd952bd846678c5e16d47ed0986c74c6b997e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 20 Apr 2020 16:32:45 +0200 Subject: Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor Subgroups were added in #37678 but not properly handled everywhere where PROPERTY_USAGE_GROUP is. --- core/global_constants.cpp | 1 + doc/classes/@GlobalScope.xml | 3 +++ editor/doc_data.cpp | 2 +- editor/plugins/script_text_editor.cpp | 2 +- modules/gdnative/include/nativescript/godot_nativescript.h | 1 + modules/gdscript/gdscript_editor.cpp | 2 +- modules/gdscript/gdscript_parser.cpp | 2 +- modules/mono/editor/bindings_generator.cpp | 2 +- 8 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 6f6b8c1dd3..afcb283e05 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -568,6 +568,7 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_GROUP); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CATEGORY); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SUBGROUP); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NO_INSTANCE_STATE); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE); diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 03176af8db..cc4158936b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1420,6 +1420,9 @@ Used to categorize properties together in the editor. + + Used to group properties together in the editor in a subgroup (under a group). + The property does not save its state in [PackedScene]. diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp index 55abc4ff2e..a71427d6fc 100644 --- a/editor/doc_data.cpp +++ b/editor/doc_data.cpp @@ -277,7 +277,7 @@ void DocData::generate(bool p_basic_types) { EO = EO->next(); } - if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_INTERNAL) + if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_SUBGROUP || E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_INTERNAL) continue; PropertyDoc prop; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 4b8383e1e5..1a77eeb9de 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -172,7 +172,7 @@ void ScriptTextEditor::_update_member_keywords() { for (List::Element *E = plist.front(); E; E = E->next()) { String name = E->get().name; - if (E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_GROUP) + if (E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_SUBGROUP) continue; if (name.find("/") != -1) continue; diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index dcf2ddb9ca..0fb5180103 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -95,6 +95,7 @@ typedef enum { GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor GODOT_PROPERTY_USAGE_CATEGORY = 256, + GODOT_PROPERTY_USAGE_SUBGROUP = 512, GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 2ec3352e70..719b87d2a0 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2057,7 +2057,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context List pinfo; ClassDB::get_property_list(type, &pinfo); for (List::Element *E = pinfo.front(); E; E = E->next()) { - if (E->get().usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_CATEGORY)) { + if (E->get().usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_CATEGORY)) { continue; } if (E->get().name.find("/") != -1) { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 8d34ce5c70..1c075fb6db 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -7364,7 +7364,7 @@ bool GDScriptParser::_get_member_type(const DataType &p_base_type, const StringN } } -#define IS_USAGE_MEMBER(m_usage) (!(m_usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_CATEGORY))) +#define IS_USAGE_MEMBER(m_usage) (!(m_usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_CATEGORY))) // Check other script types while (scr.is_valid()) { diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 71bb8ff851..ee92a6234a 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -2383,7 +2383,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { for (const List::Element *E = property_list.front(); E; E = E->next()) { const PropertyInfo &property = E->get(); - if (property.usage & PROPERTY_USAGE_GROUP || property.usage & PROPERTY_USAGE_CATEGORY) + if (property.usage & PROPERTY_USAGE_GROUP || property.usage & PROPERTY_USAGE_SUBGROUP || property.usage & PROPERTY_USAGE_CATEGORY) continue; PropertyInterface iprop; -- cgit v1.2.3