aboutsummaryrefslogtreecommitdiff
path: root/editor/editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2018-02-19 22:04:42 +0100
committerGitHub2018-02-19 22:04:42 +0100
commit693f5426d474c9d4bfa96e1f72f6815cfab61e6a (patch)
tree96f8cbfd56a399e3cdc1d937a5792e2c93ec6dfb /editor/editor_plugin.cpp
parente7fb14351533f823cdc1261c3905ac8d5cb82f47 (diff)
parentdd6313710ec9ef85d9fcaf272e828cafded04177 (diff)
downloadgodot-693f5426d474c9d4bfa96e1f72f6815cfab61e6a.tar.gz
godot-693f5426d474c9d4bfa96e1f72f6815cfab61e6a.tar.zst
godot-693f5426d474c9d4bfa96e1f72f6815cfab61e6a.zip
Merge pull request #16709 from willnationsdev/autoload-edit
Enable EditorPlugin to add/remove autoloads
Diffstat (limited to 'editor/editor_plugin.cpp')
-rw-r--r--editor/editor_plugin.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 733680645..31d0bfa8a 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -301,6 +301,14 @@ void EditorPlugin::remove_custom_type(const String &p_type) {
EditorNode::get_editor_data().remove_custom_type(p_type);
}
+void EditorPlugin::add_autoload_singleton(const String &p_name, const String &p_path) {
+ EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_add(p_name, p_path);
+}
+
+void EditorPlugin::remove_autoload_singleton(const String &p_name) {
+ EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_remove(p_name);
+}
+
ToolButton *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const String &p_title) {
return EditorNode::get_singleton()->add_bottom_panel_item(p_title, p_control);
@@ -705,6 +713,9 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_custom_type", "type", "base", "script", "icon"), &EditorPlugin::add_custom_type);
ClassDB::bind_method(D_METHOD("remove_custom_type", "type"), &EditorPlugin::remove_custom_type);
+ ClassDB::bind_method(D_METHOD("add_autoload_singleton", "name", "path"), &EditorPlugin::add_autoload_singleton);
+ ClassDB::bind_method(D_METHOD("remove_autoload_singleton", "name"), &EditorPlugin::remove_autoload_singleton);
+
ClassDB::bind_method(D_METHOD("update_overlays"), &EditorPlugin::update_overlays);
ClassDB::bind_method(D_METHOD("make_bottom_panel_item_visible", "item"), &EditorPlugin::make_bottom_panel_item_visible);