From 681969d5b396c46d187e5005b6f0853605531e7e Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 27 Mar 2016 18:23:50 +0100 Subject: Adds .fnt extension if not provided, issue 162 --- tools/editor/io_plugins/editor_font_import_plugin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/editor/io_plugins') 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 rimd = get_rimd(); if (rimd.is_null()) { -- cgit v1.2.3