Merge pull request #53936 from jmb462/fix-plugin-create-dialog
This commit is contained in:
commit
95ff49265b
@ -124,6 +124,10 @@ void PluginConfigDialog::_on_cancelled() {
|
|||||||
_clear_fields();
|
_clear_fields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginConfigDialog::_on_language_changed(const int) {
|
||||||
|
_on_required_text_changed(String());
|
||||||
|
}
|
||||||
|
|
||||||
void PluginConfigDialog::_on_required_text_changed(const String &) {
|
void PluginConfigDialog::_on_required_text_changed(const String &) {
|
||||||
int lang_idx = script_option_edit->get_selected();
|
int lang_idx = script_option_edit->get_selected();
|
||||||
String ext = ScriptServer::get_language(lang_idx)->get_extension();
|
String ext = ScriptServer::get_language(lang_idx)->get_extension();
|
||||||
@ -161,6 +165,9 @@ void PluginConfigDialog::_on_required_text_changed(const String &) {
|
|||||||
is_valid = false;
|
is_valid = false;
|
||||||
subfolder_validation->set_texture(invalid_icon);
|
subfolder_validation->set_texture(invalid_icon);
|
||||||
subfolder_validation->set_tooltip(TTR("Subfolder cannot be blank."));
|
subfolder_validation->set_tooltip(TTR("Subfolder cannot be blank."));
|
||||||
|
} else if (!subfolder_edit->get_text().is_valid_filename()) {
|
||||||
|
subfolder_validation->set_texture(invalid_icon);
|
||||||
|
subfolder_validation->set_tooltip(TTR("Subfolder name is not a valid folder name."));
|
||||||
} else {
|
} else {
|
||||||
DirAccessRef dir = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
DirAccessRef dir = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||||
String path = "res://addons/" + subfolder_edit->get_text();
|
String path = "res://addons/" + subfolder_edit->get_text();
|
||||||
@ -330,6 +337,7 @@ PluginConfigDialog::PluginConfigDialog() {
|
|||||||
}
|
}
|
||||||
script_option_edit->select(default_lang);
|
script_option_edit->select(default_lang);
|
||||||
grid->add_child(script_option_edit);
|
grid->add_child(script_option_edit);
|
||||||
|
script_option_edit->connect("item_selected", callable_mp(this, &PluginConfigDialog::_on_language_changed));
|
||||||
|
|
||||||
// Plugin Script Name
|
// Plugin Script Name
|
||||||
Label *script_lb = memnew(Label);
|
Label *script_lb = memnew(Label);
|
||||||
|
@ -59,6 +59,7 @@ class PluginConfigDialog : public ConfirmationDialog {
|
|||||||
void _clear_fields();
|
void _clear_fields();
|
||||||
void _on_confirmed();
|
void _on_confirmed();
|
||||||
void _on_cancelled();
|
void _on_cancelled();
|
||||||
|
void _on_language_changed(const int p_language);
|
||||||
void _on_required_text_changed(const String &p_text);
|
void _on_required_text_changed(const String &p_text);
|
||||||
|
|
||||||
static String _to_absolute_plugin_path(const String &p_plugin_name);
|
static String _to_absolute_plugin_path(const String &p_plugin_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user