Skip to content

Commit

Permalink
Fix plugin wizard's generated filenames
Browse files Browse the repository at this point in the history
Fix automatic folder naming snake_case conversion.
Use plugin.gd as a default script name as advertised.
  • Loading branch information
aXu-AP committed Apr 25, 2024
1 parent e0f58a3 commit 1c0ea44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/plugin_config_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void PluginConfigDialog::_on_confirmed() {
return;
}
String ext = language->get_extension();
String script_name = script_edit->get_text().is_empty() ? _get_subfolder() : script_edit->get_text();
String script_name = script_edit->get_text().is_empty() ? "plugin" : script_edit->get_text();
if (script_name.get_extension() != ext) {
script_name += "." + ext;
}
Expand Down Expand Up @@ -140,7 +140,7 @@ void PluginConfigDialog::_on_required_text_changed() {
}

String PluginConfigDialog::_get_subfolder() {
return subfolder_edit->get_text().is_empty() ? name_edit->get_text().replace(" ", "_").to_lower() : subfolder_edit->get_text();
return subfolder_edit->get_text().is_empty() ? name_edit->get_text().to_snake_case() : subfolder_edit->get_text();
}

String PluginConfigDialog::_to_absolute_plugin_path(const String &p_plugin_name) {
Expand Down

0 comments on commit 1c0ea44

Please sign in to comment.