Added inspector_only option to inspect_object in EditorInterface.

Updated docs to reflect change to inspect_object.
This commit is contained in:
andriyDev 2020-09-16 15:27:19 -04:00
parent 6ac7b90097
commit 45a1c6f278
3 changed files with 7 additions and 5 deletions

View file

@ -125,8 +125,10 @@
</argument> </argument>
<argument index="1" name="for_property" type="String" default="&quot;&quot;"> <argument index="1" name="for_property" type="String" default="&quot;&quot;">
</argument> </argument>
<argument index="2" name="inspector_only" type="bool" default="false">
</argument>
<description> <description>
Shows the given property on the given [code]object[/code] in the editor's Inspector dock. Shows the given property on the given [code]object[/code] in the editor's Inspector dock. If [code]inspector_only[/code] is [code]true[/code], plugins will not attempt to edit [code]object[/code].
</description> </description>
</method> </method>
<method name="is_playing_scene" qualifiers="const"> <method name="is_playing_scene" qualifiers="const">

View file

@ -234,8 +234,8 @@ String EditorInterface::get_current_path() const {
return EditorNode::get_singleton()->get_filesystem_dock()->get_current_path(); return EditorNode::get_singleton()->get_filesystem_dock()->get_current_path();
} }
void EditorInterface::inspect_object(Object *p_obj, const String &p_for_property) { void EditorInterface::inspect_object(Object *p_obj, const String &p_for_property, bool p_inspector_only) {
EditorNode::get_singleton()->push_item(p_obj, p_for_property); EditorNode::get_singleton()->push_item(p_obj, p_for_property, p_inspector_only);
} }
EditorFileSystem *EditorInterface::get_resource_file_system() { EditorFileSystem *EditorInterface::get_resource_file_system() {
@ -301,7 +301,7 @@ bool EditorInterface::is_distraction_free_mode_enabled() const {
EditorInterface *EditorInterface::singleton = nullptr; EditorInterface *EditorInterface::singleton = nullptr;
void EditorInterface::_bind_methods() { void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("inspect_object", "object", "for_property"), &EditorInterface::inspect_object, DEFVAL(String())); ClassDB::bind_method(D_METHOD("inspect_object", "object", "for_property", "inspector_only"), &EditorInterface::inspect_object, DEFVAL(String()), DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_selection"), &EditorInterface::get_selection); ClassDB::bind_method(D_METHOD("get_selection"), &EditorInterface::get_selection);
ClassDB::bind_method(D_METHOD("get_editor_settings"), &EditorInterface::get_editor_settings); ClassDB::bind_method(D_METHOD("get_editor_settings"), &EditorInterface::get_editor_settings);
ClassDB::bind_method(D_METHOD("get_script_editor"), &EditorInterface::get_script_editor); ClassDB::bind_method(D_METHOD("get_script_editor"), &EditorInterface::get_script_editor);

View file

@ -89,7 +89,7 @@ public:
String get_selected_path() const; String get_selected_path() const;
String get_current_path() const; String get_current_path() const;
void inspect_object(Object *p_obj, const String &p_for_property = String()); void inspect_object(Object *p_obj, const String &p_for_property = String(), bool p_inspector_only = false);
EditorSelection *get_selection(); EditorSelection *get_selection();
//EditorImportExport *get_import_export(); //EditorImportExport *get_import_export();