diff options
Diffstat (limited to 'editor/editor_plugin.cpp')
| -rw-r--r-- | editor/editor_plugin.cpp | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index c0cecbc651..c5097a17a5 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -32,6 +32,7 @@  #include "editor/editor_export.h"  #include "editor/editor_node.h" +#include "editor/editor_paths.h"  #include "editor/editor_settings.h"  #include "editor/filesystem_dock.h"  #include "editor/project_settings_editor.h" @@ -160,6 +161,10 @@ void EditorInterface::edit_resource(const Ref<Resource> &p_resource) {  	EditorNode::get_singleton()->edit_resource(p_resource);  } +void EditorInterface::edit_node(Node *p_node) { +	EditorNode::get_singleton()->edit_node(p_node); +} +  void EditorInterface::open_scene_from_path(const String &scene_path) {  	if (EditorNode::get_singleton()->is_changing_scene()) {  		return; @@ -253,6 +258,9 @@ EditorSelection *EditorInterface::get_selection() {  Ref<EditorSettings> EditorInterface::get_editor_settings() {  	return EditorSettings::get_singleton();  } +EditorPaths *EditorInterface::get_editor_paths() { +	return EditorPaths::get_singleton(); +}  EditorResourcePreview *EditorInterface::get_resource_previewer() {  	return EditorResourcePreview::get_singleton(); @@ -262,6 +270,10 @@ Control *EditorInterface::get_base_control() {  	return EditorNode::get_singleton()->get_gui_base();  } +float EditorInterface::get_editor_scale() const { +	return EDSCALE; +} +  void EditorInterface::set_plugin_enabled(const String &p_plugin, bool p_enabled) {  	EditorNode::get_singleton()->set_addon_plugin_enabled(p_plugin, p_enabled, true);  } @@ -306,7 +318,9 @@ void EditorInterface::_bind_methods() {  	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_base_control"), &EditorInterface::get_base_control); +	ClassDB::bind_method(D_METHOD("get_editor_scale"), &EditorInterface::get_editor_scale);  	ClassDB::bind_method(D_METHOD("edit_resource", "resource"), &EditorInterface::edit_resource); +	ClassDB::bind_method(D_METHOD("edit_node", "node"), &EditorInterface::edit_node);  	ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorInterface::open_scene_from_path);  	ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorInterface::reload_scene_from_path);  	ClassDB::bind_method(D_METHOD("play_main_scene"), &EditorInterface::play_main_scene); @@ -325,6 +339,7 @@ void EditorInterface::_bind_methods() {  	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("get_file_system_dock"), &EditorInterface::get_file_system_dock); +	ClassDB::bind_method(D_METHOD("get_editor_paths"), &EditorInterface::get_editor_paths);  	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); @@ -693,6 +708,14 @@ bool EditorPlugin::get_remove_list(List<Node *> *p_list) {  void EditorPlugin::restore_global_state() {}  void EditorPlugin::save_global_state() {} +void EditorPlugin::add_undo_redo_inspector_hook_callback(Callable p_callable) { +	EditorNode::get_singleton()->get_editor_data().add_undo_redo_inspector_hook_callback(p_callable); +} + +void EditorPlugin::remove_undo_redo_inspector_hook_callback(Callable p_callable) { +	EditorNode::get_singleton()->get_editor_data().remove_undo_redo_inspector_hook_callback(p_callable); +} +  void EditorPlugin::add_translation_parser_plugin(const Ref<EditorTranslationParserPlugin> &p_parser) {  	EditorTranslationParser::get_singleton()->add_parser(p_parser, EditorTranslationParser::CUSTOM);  } @@ -852,6 +875,8 @@ void EditorPlugin::_bind_methods() {  	ClassDB::bind_method(D_METHOD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel);  	ClassDB::bind_method(D_METHOD("get_undo_redo"), &EditorPlugin::_get_undo_redo); +	ClassDB::bind_method(D_METHOD("add_undo_redo_inspector_hook_callback", "callable"), &EditorPlugin::add_undo_redo_inspector_hook_callback); +	ClassDB::bind_method(D_METHOD("remove_undo_redo_inspector_hook_callback", "callable"), &EditorPlugin::remove_undo_redo_inspector_hook_callback);  	ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout);  	ClassDB::bind_method(D_METHOD("add_translation_parser_plugin", "parser"), &EditorPlugin::add_translation_parser_plugin);  	ClassDB::bind_method(D_METHOD("remove_translation_parser_plugin", "parser"), &EditorPlugin::remove_translation_parser_plugin);  |