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) {
|
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()) {
|
if (!name.empty()) {
|
||||||
settings.default_symbol_dir = wxPathOnly(name);
|
settings.default_symbol_dir = wxPathOnly(name);
|
||||||
wxFileName n(name);
|
wxFileName n(name);
|
||||||
@@ -221,8 +221,11 @@ void SymbolWindow::onFileOpen(wxCommandEvent& ev) {
|
|||||||
reader.handle_greedy(symbol);
|
reader.handle_greedy(symbol);
|
||||||
} else {
|
} else {
|
||||||
wxBusyCursor busy;
|
wxBusyCursor busy;
|
||||||
Image image(name);
|
Image image(name);
|
||||||
if (!image.Ok()) return;
|
if (!image.Ok()) {
|
||||||
|
queue_message(MESSAGE_ERROR, _ERROR_("can't load image"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
symbol = import_symbol(image);
|
symbol = import_symbol(image);
|
||||||
}
|
}
|
||||||
// show...
|
// show...
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ bool ImageValueEditor::onLeftDClick(const RealPoint&, wxMouseEvent&) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
filename = wxFileSelector(_("Open image file"), directory, filename, _(""),
|
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()));
|
wxFD_OPEN, wxGetTopLevelParent(&editor()));
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
settings.default_image_dir = wxPathOnly(filename);
|
settings.default_image_dir = wxPathOnly(filename);
|
||||||
@@ -42,8 +42,9 @@ bool ImageValueEditor::onLeftDClick(const RealPoint&, wxMouseEvent&) {
|
|||||||
{
|
{
|
||||||
wxLogNull noLog;
|
wxLogNull noLog;
|
||||||
image = wxImage(filename);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user