|
@@ -414,6 +414,18 @@ StringName EditorProperty::get_edited_property() const {
|
|
|
return property;
|
|
|
}
|
|
|
|
|
|
+EditorInspector *EditorProperty::get_parent_inspector() const {
|
|
|
+ Node *parent = get_parent();
|
|
|
+ while (parent) {
|
|
|
+ EditorInspector *ei = Object::cast_to<EditorInspector>(parent);
|
|
|
+ if (ei) {
|
|
|
+ return ei;
|
|
|
+ }
|
|
|
+ parent = parent->get_parent();
|
|
|
+ }
|
|
|
+ ERR_FAIL_V_MSG(nullptr, "EditorProperty is outside inspector.");
|
|
|
+}
|
|
|
+
|
|
|
void EditorProperty::set_doc_path(const String &p_doc_path) {
|
|
|
doc_path = p_doc_path;
|
|
|
}
|
|
@@ -2484,6 +2496,10 @@ Button *EditorInspector::create_inspector_action_button(const String &p_text) {
|
|
|
return button;
|
|
|
}
|
|
|
|
|
|
+bool EditorInspector::is_main_editor_inspector() const {
|
|
|
+ return InspectorDock::get_singleton() && InspectorDock::get_inspector_singleton() == this;
|
|
|
+}
|
|
|
+
|
|
|
String EditorInspector::get_selected_path() const {
|
|
|
return property_selected;
|
|
|
}
|
|
@@ -3286,7 +3302,7 @@ void EditorInspector::update_tree() {
|
|
|
_parse_added_editors(main_vbox, nullptr, ped);
|
|
|
}
|
|
|
|
|
|
- if (_is_main_editor_inspector()) {
|
|
|
+ if (is_main_editor_inspector()) {
|
|
|
// Updating inspector might invalidate some editing owners.
|
|
|
EditorNode::get_singleton()->hide_unused_editors();
|
|
|
}
|
|
@@ -3316,7 +3332,7 @@ void EditorInspector::_clear(bool p_hide_plugins) {
|
|
|
pending.clear();
|
|
|
restart_request_props.clear();
|
|
|
|
|
|
- if (p_hide_plugins && _is_main_editor_inspector()) {
|
|
|
+ if (p_hide_plugins && is_main_editor_inspector()) {
|
|
|
EditorNode::get_singleton()->hide_unused_editors(this);
|
|
|
}
|
|
|
}
|
|
@@ -3652,10 +3668,6 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-bool EditorInspector::_is_main_editor_inspector() const {
|
|
|
- return InspectorDock::get_singleton() && InspectorDock::get_inspector_singleton() == this;
|
|
|
-}
|
|
|
-
|
|
|
void EditorInspector::_property_changed(const String &p_path, const Variant &p_value, const String &p_name, bool p_changing, bool p_update_all) {
|
|
|
// The "changing" variable must be true for properties that trigger events as typing occurs,
|
|
|
// like "text_changed" signal. E.g. text property of Label, Button, RichTextLabel, etc.
|