summaryrefslogtreecommitdiff
path: root/tools/editor/io_plugins
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2016-03-27 18:23:50 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2016-03-27 18:24:28 +0100
commit681969d5b396c46d187e5005b6f0853605531e7e (patch)
tree44cdbdbc7209cb268954872e3bd646fbf922f89a /tools/editor/io_plugins
parent15d1fca0614ad87fd16fa7532e4db867b342d00e (diff)
Adds .fnt extension if not provided, issue 162
Diffstat (limited to 'tools/editor/io_plugins')
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp
index ff126a8e8c..5ea1a00ba8 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp
@@ -524,6 +524,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()) {