summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
authorWill Nations <willnationsdev@gmail.com>2018-07-19 10:34:22 -0500
committerWill Nations <willnationsdev@gmail.com>2018-07-26 10:12:05 -0500
commitff604414a4730ba49409afca22e1c7aa44d0c338 (patch)
tree6ecbfb978534a4420e1acd8e5470e818e6e854ef /editor/editor_node.cpp
parent91d6fa817ec412b1cb7a753e812e76aa952a7ac0 (diff)
Add PluginConfigDialog, EditorPluginSettings GUI
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 05fbf7aa76..c59882b677 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -408,6 +408,18 @@ void EditorNode::_notification(int p_what) {
}
}
+void EditorNode::_on_plugin_ready(Object *p_script, const String &p_activate_name) {
+ Ref<Script> script = Object::cast_to<Script>(p_script);
+ if (script.is_null())
+ return;
+ if (p_activate_name.length()) {
+ set_addon_plugin_enabled(p_activate_name, true);
+ }
+ project_settings->update_plugins();
+ project_settings->hide();
+ push_item(script.operator->());
+}
+
void EditorNode::_fs_changed() {
for (Set<FileDialog *>::Element *E = file_dialogs.front(); E; E = E->next()) {
@@ -2540,6 +2552,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled)
EditorPlugin *ep = memnew(EditorPlugin);
ep->set_script(script.get_ref_ptr());
+ ep->set_dir_cache(p_addon);
plugin_addons[p_addon] = ep;
add_editor_plugin(ep);
@@ -4520,6 +4533,8 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("_resources_reimported"), &EditorNode::_resources_reimported);
ClassDB::bind_method(D_METHOD("_bottom_panel_raise_toggled"), &EditorNode::_bottom_panel_raise_toggled);
+ ClassDB::bind_method(D_METHOD("_on_plugin_ready"), &EditorNode::_on_plugin_ready);
+
ClassDB::bind_method(D_METHOD("_video_driver_selected"), &EditorNode::_video_driver_selected);
ADD_SIGNAL(MethodInfo("play_pressed"));
@@ -5082,6 +5097,10 @@ EditorNode::EditorNode() {
p->connect("id_pressed", this, "_menu_option");
p->add_item(TTR("Export"), FILE_EXPORT_PROJECT);
+ plugin_config_dialog = memnew(PluginConfigDialog);
+ plugin_config_dialog->connect("plugin_ready", this, "_on_plugin_ready");
+ gui_base->add_child(plugin_config_dialog);
+
tool_menu = memnew(PopupMenu);
tool_menu->set_name("Tools");
tool_menu->connect("index_pressed", this, "_tool_menu_option");