Merge pull request #38045 from akien-mga/fix-subgroup-property
Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor
This commit is contained in:
commit
4e4fcbd793
@ -568,6 +568,7 @@ void register_global_constants() {
|
|||||||
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED);
|
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED);
|
||||||
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_GROUP);
|
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_GROUP);
|
||||||
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CATEGORY);
|
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_NO_INSTANCE_STATE);
|
||||||
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED);
|
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||||
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE);
|
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE);
|
||||||
|
@ -1420,6 +1420,9 @@
|
|||||||
<constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags">
|
<constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags">
|
||||||
Used to categorize properties together in the editor.
|
Used to categorize properties together in the editor.
|
||||||
</constant>
|
</constant>
|
||||||
|
<constant name="PROPERTY_USAGE_SUBGROUP" value="512" enum="PropertyUsageFlags">
|
||||||
|
Used to group properties together in the editor in a subgroup (under a group).
|
||||||
|
</constant>
|
||||||
<constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048" enum="PropertyUsageFlags">
|
<constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048" enum="PropertyUsageFlags">
|
||||||
The property does not save its state in [PackedScene].
|
The property does not save its state in [PackedScene].
|
||||||
</constant>
|
</constant>
|
||||||
|
@ -277,7 +277,7 @@ void DocData::generate(bool p_basic_types) {
|
|||||||
EO = EO->next();
|
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;
|
continue;
|
||||||
|
|
||||||
PropertyDoc prop;
|
PropertyDoc prop;
|
||||||
|
@ -172,7 +172,7 @@ void ScriptTextEditor::_update_member_keywords() {
|
|||||||
|
|
||||||
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
||||||
String name = E->get().name;
|
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;
|
continue;
|
||||||
if (name.find("/") != -1)
|
if (name.find("/") != -1)
|
||||||
continue;
|
continue;
|
||||||
|
@ -95,6 +95,7 @@ typedef enum {
|
|||||||
GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings
|
GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings
|
||||||
GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor
|
GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor
|
||||||
GODOT_PROPERTY_USAGE_CATEGORY = 256,
|
GODOT_PROPERTY_USAGE_CATEGORY = 256,
|
||||||
|
GODOT_PROPERTY_USAGE_SUBGROUP = 512,
|
||||||
GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048,
|
GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048,
|
||||||
GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096,
|
GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096,
|
||||||
GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192,
|
GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192,
|
||||||
|
@ -2057,7 +2057,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context
|
|||||||
List<PropertyInfo> pinfo;
|
List<PropertyInfo> pinfo;
|
||||||
ClassDB::get_property_list(type, &pinfo);
|
ClassDB::get_property_list(type, &pinfo);
|
||||||
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::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;
|
continue;
|
||||||
}
|
}
|
||||||
if (E->get().name.find("/") != -1) {
|
if (E->get().name.find("/") != -1) {
|
||||||
|
@ -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
|
// Check other script types
|
||||||
while (scr.is_valid()) {
|
while (scr.is_valid()) {
|
||||||
|
@ -2383,7 +2383,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||||||
for (const List<PropertyInfo>::Element *E = property_list.front(); E; E = E->next()) {
|
for (const List<PropertyInfo>::Element *E = property_list.front(); E; E = E->next()) {
|
||||||
const PropertyInfo &property = E->get();
|
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;
|
continue;
|
||||||
|
|
||||||
PropertyInterface iprop;
|
PropertyInterface iprop;
|
||||||
|
Loading…
Reference in New Issue
Block a user