mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
add webp support
This commit is contained in:
@@ -209,7 +209,7 @@ void SymbolWindow::onFileNew(wxCommandEvent& ev) {
|
||||
}
|
||||
|
||||
void SymbolWindow::onFileOpen(wxCommandEvent& ev) {
|
||||
String name = wxFileSelector(_("Open symbol"),settings.default_symbol_dir,_(""),_(""),_("Symbol files|*.mse-symbol;*.bmp|MSE2 symbol files (*.mse-symbol)|*.mse-symbol|Images/MSE1 symbol files|*.bmp;*.png;*.jpg;*.gif"),wxFD_OPEN|wxFD_FILE_MUST_EXIST, this);
|
||||
String name = wxFileSelector(_("Open symbol"),settings.default_symbol_dir,_(""),_(""),_("All files|*.mse-symbol;*.bmp;*.jpg;*.jpeg;*.png;*.webp;*.gif;*.tif;*.tiff|MSE2 symbol files (*.mse-symbol)|*.mse-symbol|Images/MSE1 symbol files|*.bmp;*.jpg;*.jpeg;*.png;*.webp;*.gif;*.tif;*.tiff"),wxFD_OPEN|wxFD_FILE_MUST_EXIST, this);
|
||||
if (!name.empty()) {
|
||||
settings.default_symbol_dir = wxPathOnly(name);
|
||||
wxFileName n(name);
|
||||
@@ -222,7 +222,10 @@ void SymbolWindow::onFileOpen(wxCommandEvent& ev) {
|
||||
} else {
|
||||
wxBusyCursor busy;
|
||||
Image image(name);
|
||||
if (!image.Ok()) return;
|
||||
if (!image.Ok()) {
|
||||
queue_message(MESSAGE_ERROR, _ERROR_("can't load image"));
|
||||
return;
|
||||
}
|
||||
symbol = import_symbol(image);
|
||||
}
|
||||
// show...
|
||||
|
||||
@@ -34,7 +34,7 @@ bool ImageValueEditor::onLeftDClick(const RealPoint&, wxMouseEvent&) {
|
||||
}
|
||||
}
|
||||
filename = wxFileSelector(_("Open image file"), directory, filename, _(""),
|
||||
_("All images|*.bmp;*.jpg;*.jpeg;*.png;*.gif;*.tif;*.tiff|Windows bitmaps (*.bmp)|*.bmp|JPEG images (*.jpg;*.jpeg)|*.jpg;*.jpeg|PNG images (*.png)|*.png|GIF images (*.gif)|*.gif|TIFF images (*.tif;*.tiff)|*.tif;*.tiff"),
|
||||
_("All images|*.bmp;*.jpg;*.jpeg;*.png;*.webp;*.gif;*.tif;*.tiff|Windows bitmaps (*.bmp)|*.bmp|JPEG images (*.jpg;*.jpeg)|*.jpg;*.jpeg|PNG images (*.png)|*.png|WebP images (*.webp)|*.webp|GIF images (*.gif)|*.gif|TIFF images (*.tif;*.tiff)|*.tif;*.tiff"),
|
||||
wxFD_OPEN, wxGetTopLevelParent(&editor()));
|
||||
if (!filename.empty()) {
|
||||
settings.default_image_dir = wxPathOnly(filename);
|
||||
@@ -43,7 +43,8 @@ bool ImageValueEditor::onLeftDClick(const RealPoint&, wxMouseEvent&) {
|
||||
wxLogNull noLog;
|
||||
image = wxImage(filename);
|
||||
}
|
||||
sliceImage(image, filename, cardname);
|
||||
if (!image.Ok()) queue_message(MESSAGE_ERROR, _ERROR_("can't load image"));
|
||||
else sliceImage(image, filename, cardname);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user