Merge pull request #81425 from Rubonnek/expose-inspector-methods-master

Expose `EditorInspector::get_edited_object` to GDScript
This commit is contained in:
Rémi Verschelde 2023-09-24 23:31:43 +02:00
commit 684effb6b4
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 7 additions and 0 deletions

View file

@ -14,6 +14,12 @@
<tutorials>
</tutorials>
<methods>
<method name="get_edited_object">
<return type="Object" />
<description>
Returns the object currently selected in this inspector.
</description>
</method>
<method name="get_selected_path" qualifiers="const">
<return type="String" />
<description>

View file

@ -4242,6 +4242,7 @@ void EditorInspector::_show_add_meta_dialog() {
void EditorInspector::_bind_methods() {
ClassDB::bind_method("_edit_request_change", &EditorInspector::_edit_request_change);
ClassDB::bind_method("get_selected_path", &EditorInspector::get_selected_path);
ClassDB::bind_method("get_edited_object", &EditorInspector::get_edited_object);
ADD_SIGNAL(MethodInfo("property_selected", PropertyInfo(Variant::STRING, "property")));
ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), PropertyInfo(Variant::BOOL, "advance")));