Merge pull request #31847 from aole/editor-expose-current-path

Expose current path function to EditorPlugin
This commit is contained in:
Rémi Verschelde 2019-09-03 12:07:23 +02:00 committed by GitHub
commit 2f727ee167
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -211,6 +211,10 @@ String EditorInterface::get_selected_path() const {
return EditorNode::get_singleton()->get_filesystem_dock()->get_selected_path(); return EditorNode::get_singleton()->get_filesystem_dock()->get_selected_path();
} }
String EditorInterface::get_current_path() const {
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) {
EditorNode::get_singleton()->push_item(p_obj, p_for_property); EditorNode::get_singleton()->push_item(p_obj, p_for_property);
@ -288,6 +292,7 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("make_mesh_previews", "meshes", "preview_size"), &EditorInterface::_make_mesh_previews); ClassDB::bind_method(D_METHOD("make_mesh_previews", "meshes", "preview_size"), &EditorInterface::_make_mesh_previews);
ClassDB::bind_method(D_METHOD("select_file", "file"), &EditorInterface::select_file); ClassDB::bind_method(D_METHOD("select_file", "file"), &EditorInterface::select_file);
ClassDB::bind_method(D_METHOD("get_selected_path"), &EditorInterface::get_selected_path); ClassDB::bind_method(D_METHOD("get_selected_path"), &EditorInterface::get_selected_path);
ClassDB::bind_method(D_METHOD("get_current_path"), &EditorInterface::get_current_path);
ClassDB::bind_method(D_METHOD("set_plugin_enabled", "plugin", "enabled"), &EditorInterface::set_plugin_enabled); ClassDB::bind_method(D_METHOD("set_plugin_enabled", "plugin", "enabled"), &EditorInterface::set_plugin_enabled);
ClassDB::bind_method(D_METHOD("is_plugin_enabled", "plugin"), &EditorInterface::is_plugin_enabled); ClassDB::bind_method(D_METHOD("is_plugin_enabled", "plugin"), &EditorInterface::is_plugin_enabled);

View file

@ -78,6 +78,7 @@ public:
void select_file(const String &p_file); void select_file(const String &p_file);
String get_selected_path() const; String get_selected_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());