mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Support for extra card fields in stylesheets;
Fixed some bugs: - Missing choice images can crash mse. - The wrong style is used for making preview choice images on style panel. FOR_EACH(x, *y.z) should now work without parentheses on linux as well. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@389 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -79,7 +79,7 @@ GraphData::GraphData(const GraphDataPre& d)
|
||||
}
|
||||
} else if (a->order) {
|
||||
// specific group order
|
||||
FOR_EACH_CONST(gn, (*(a->order))) {
|
||||
FOR_EACH_CONST(gn, *a->order) {
|
||||
UInt count = counts[gn];
|
||||
a->groups.push_back(GraphGroup(gn, count));
|
||||
a->max = max(a->max, count);
|
||||
|
||||
@@ -192,7 +192,7 @@ StylingEditor::StylingEditor(Window* parent, int id, long style)
|
||||
{}
|
||||
|
||||
void StylingEditor::showStylesheet(const StyleSheetP& stylesheet) {
|
||||
setStyles(set->stylesheet, stylesheet->styling_style);
|
||||
setStyles(stylesheet, stylesheet->styling_style);
|
||||
setData(set->stylingDataFor(*stylesheet));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <wx/spinctrl.h>
|
||||
|
||||
class ImageSlicePreview;
|
||||
class ImageSliceSelector;
|
||||
class wxSpinEvent;
|
||||
class wxSpinCtrl;
|
||||
DECLARE_POINTER_TYPE(AlphaMask);
|
||||
|
||||
// ----------------------------------------------------------------------------- : ImageSlice
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <gui/thumbnail_thread.hpp>
|
||||
#include <util/platform.hpp>
|
||||
#include <util/error.hpp>
|
||||
#include <wx/thread.h>
|
||||
|
||||
typedef pair<ThumbnailRequestP,Image> pair_ThumbnailRequestP_Image;
|
||||
@@ -71,7 +72,13 @@ wxThread::ExitCode ThumbnailThreadWorker::Entry() {
|
||||
parent->open_requests.pop_front();
|
||||
}
|
||||
// perform request
|
||||
Image img = current->generate();
|
||||
Image img;
|
||||
try {
|
||||
img = current->generate();
|
||||
} catch (const Error& e) {
|
||||
handle_error(e, false, false);
|
||||
} catch (...) {
|
||||
}
|
||||
// store in cache
|
||||
if (img.Ok()) {
|
||||
String filename = image_cache_dir() + safe_filename(current->cache_name) + _(".png");
|
||||
|
||||
@@ -196,8 +196,13 @@ bool TextValueEditor::onChar(wxKeyEvent& ev) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
#ifdef __WXMSW__
|
||||
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
||||
// This check is need, otherwise pressing a key, say "0" on the numpad produces "a0"
|
||||
// (don't ask me why)
|
||||
#else
|
||||
if (ev.GetKeyCode() >= _(' ') /*&& ev.GetKeyCode() == (int)ev.GetRawKeyCode()*/) {
|
||||
// if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
||||
#endif
|
||||
// TODO: Find a more correct way to determine normal characters,
|
||||
// this might not work for internationalized input.
|
||||
// It might also not be portable!
|
||||
|
||||
Reference in New Issue
Block a user