Merge pull request #4158 from Paulb23/add_fnt_extension_issue_162

Adds .fnt extension if not provided, issue #162
This commit is contained in:
Rémi Verschelde 2016-06-19 01:04:46 +02:00 committed by GitHub
commit bd79aa52ab

View file

@ -528,6 +528,16 @@ class EditorFontImportDialog : public ConfirmationDialog {
dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().basename() + ".fnt" );
}
if (dest->get_line_edit()->get_text().extension() == dest->get_line_edit()->get_text()) {
dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".fnt");
}
if (dest->get_line_edit()->get_text().extension().to_lower() != "fnt") {
error_dialog->set_text("Invalid file extension. \nPlease use .fnt");
error_dialog->popup_centered(Size2(200,100));
return;
}
Ref<ResourceImportMetadata> rimd = get_rimd();
if (rimd.is_null()) {