Merge pull request #86467 from KoBeWi/aliens_in_my_inspector
Always call `_can_handle()` before `_parse_property()`
This commit is contained in:
commit
783c99d5e1
|
@ -2598,6 +2598,10 @@ int EditorInspector::inspector_plugin_count = 0;
|
||||||
|
|
||||||
EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, const Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) {
|
EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, const Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) {
|
||||||
for (int i = inspector_plugin_count - 1; i >= 0; i--) {
|
for (int i = inspector_plugin_count - 1; i >= 0; i--) {
|
||||||
|
if (!inspector_plugins[i]->can_handle(p_object)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
inspector_plugins[i]->parse_property(p_object, p_type, p_path, p_hint, p_hint_text, p_usage, p_wide);
|
inspector_plugins[i]->parse_property(p_object, p_type, p_path, p_hint, p_hint_text, p_usage, p_wide);
|
||||||
if (inspector_plugins[i]->added_editors.size()) {
|
if (inspector_plugins[i]->added_editors.size()) {
|
||||||
for (List<EditorInspectorPlugin::AddedEditor>::Element *E = inspector_plugins[i]->added_editors.front()->next(); E; E = E->next()) { //only keep first one
|
for (List<EditorInspectorPlugin::AddedEditor>::Element *E = inspector_plugins[i]->added_editors.front()->next(); E; E = E->next()) { //only keep first one
|
||||||
|
|
|
@ -435,7 +435,7 @@ void EditorPropertyArray::update_property() {
|
||||||
editor->setup("Object");
|
editor->setup("Object");
|
||||||
new_prop = editor;
|
new_prop = editor;
|
||||||
} else {
|
} else {
|
||||||
new_prop = EditorInspector::instantiate_property_editor(nullptr, value_type, "", subtype_hint, subtype_hint_string, PROPERTY_USAGE_NONE);
|
new_prop = EditorInspector::instantiate_property_editor(this, value_type, "", subtype_hint, subtype_hint_string, PROPERTY_USAGE_NONE);
|
||||||
}
|
}
|
||||||
new_prop->set_selectable(false);
|
new_prop->set_selectable(false);
|
||||||
new_prop->set_use_folding(is_using_folding());
|
new_prop->set_use_folding(is_using_folding());
|
||||||
|
@ -1064,7 +1064,7 @@ void EditorPropertyDictionary::update_property() {
|
||||||
editor->setup("Object");
|
editor->setup("Object");
|
||||||
new_prop = editor;
|
new_prop = editor;
|
||||||
} else {
|
} else {
|
||||||
new_prop = EditorInspector::instantiate_property_editor(nullptr, value_type, "", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE);
|
new_prop = EditorInspector::instantiate_property_editor(this, value_type, "", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE);
|
||||||
}
|
}
|
||||||
new_prop->set_selectable(false);
|
new_prop->set_selectable(false);
|
||||||
new_prop->set_use_folding(is_using_folding());
|
new_prop->set_use_folding(is_using_folding());
|
||||||
|
|
Loading…
Reference in New Issue