You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Merge pull request #19837 from willnationsdev/plugin-utilities
Add PluginConfigDialog.
This commit is contained in:
@@ -411,6 +411,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()) {
|
||||
@@ -2547,6 +2559,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);
|
||||
|
||||
@@ -4548,6 +4561,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"));
|
||||
@@ -5134,6 +5149,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");
|
||||
|
||||
Reference in New Issue
Block a user