diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index b728ce64c99..85a906ef512 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -200,12 +200,9 @@ EditorPluginSettings::EditorPluginSettings() { l->set_theme_type_variation("HeaderSmall"); title_hb->add_child(l); title_hb->add_spacer(); - create_plugin = memnew(Button(TTR("Create"))); + Button *create_plugin = memnew(Button(TTR("Create New Plugin"))); create_plugin->connect("pressed", callable_mp(this, &EditorPluginSettings::_create_clicked)); title_hb->add_child(create_plugin); - update_list = memnew(Button(TTR("Update"))); - update_list->connect("pressed", callable_mp(this, &EditorPluginSettings::update_plugins)); - title_hb->add_child(update_list); add_child(title_hb); plugin_list = memnew(Tree); diff --git a/editor/editor_plugin_settings.h b/editor/editor_plugin_settings.h index 826bb8c00f5..121534b6134 100644 --- a/editor/editor_plugin_settings.h +++ b/editor/editor_plugin_settings.h @@ -45,8 +45,6 @@ class EditorPluginSettings : public VBoxContainer { }; PluginConfigDialog *plugin_config_dialog = nullptr; - Button *create_plugin = nullptr; - Button *update_list = nullptr; Tree *plugin_list = nullptr; bool updating = false; diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 755bf7ce076..77e49053413 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -47,7 +47,7 @@ void PluginConfigDialog::_clear_fields() { } void PluginConfigDialog::_on_confirmed() { - String path = "res://addons/" + subfolder_edit->get_text(); + String path = "res://addons/" + _get_subfolder(); if (!_edit_mode) { Ref d = DirAccess::create(DirAccess::ACCESS_RESOURCES); @@ -56,32 +56,35 @@ void PluginConfigDialog::_on_confirmed() { } } + int lang_idx = script_option_edit->get_selected(); + String ext = ScriptServer::get_language(lang_idx)->get_extension(); + String script_name = script_edit->get_text().is_empty() ? _get_subfolder() : script_edit->get_text(); + if (script_name.get_extension().is_empty()) { + script_name += "." + ext; + } + String script_path = path.plus_file(script_name); + Ref cf = memnew(ConfigFile); cf->set_value("plugin", "name", name_edit->get_text()); cf->set_value("plugin", "description", desc_edit->get_text()); cf->set_value("plugin", "author", author_edit->get_text()); cf->set_value("plugin", "version", version_edit->get_text()); - cf->set_value("plugin", "script", script_edit->get_text()); + cf->set_value("plugin", "script", script_name); cf->save(path.plus_file("plugin.cfg")); if (!_edit_mode) { - int lang_idx = script_option_edit->get_selected(); - String lang_name = ScriptServer::get_language(lang_idx)->get_name(); - - Ref