mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Choice rendering now uses "style.image()" instead of "style.choice_images[value]";
Added script functions for working with multiple choice values; Added in_context support for filter_rule; Optimized toUpper/toLower because they are slow on windows (they use thread local storage and mutexes) git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@427 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -19,9 +19,15 @@ void ChoiceValueViewer::draw(RotatedDC& dc) {
|
||||
double margin = 0;
|
||||
if (style().render_style & RENDER_IMAGE) {
|
||||
// draw image
|
||||
map<String,ScriptableImage>::iterator it = style().choice_images.find(cannocial_name_form(value().value()));
|
||||
if (it != style().choice_images.end() && it->second.isReady()) {
|
||||
ScriptableImage& img = it->second;
|
||||
// map<String,ScriptableImage>::iterator it = style().choice_images.find(cannocial_name_form(value().value()));
|
||||
// if (it != style().choice_images.end() && it->second.isReady()) {
|
||||
// ScriptableImage& img = it->second;
|
||||
style().initImage();
|
||||
ScriptableImage& img = style().image;
|
||||
Context& ctx = viewer.getContext();
|
||||
ctx.setVariable(_("input"), to_script(value().value()));
|
||||
img.update(ctx);
|
||||
if (img.isReady()) {
|
||||
GeneratedImage::Options img_options(0,0, viewer.stylesheet.get(), &getSet());
|
||||
if (nativeLook()) {
|
||||
img_options.width = img_options.height = 16;
|
||||
|
||||
@@ -43,9 +43,12 @@ void MultipleChoiceValueViewer::draw(RotatedDC& dc) {
|
||||
double margin = 0;
|
||||
if (style().render_style & RENDER_IMAGE) {
|
||||
// draw image
|
||||
map<String,ScriptableImage>::iterator it = style().choice_images.find(cannocial_name_form(value().value()));
|
||||
if (it != style().choice_images.end() && it->second.isReady()) {
|
||||
ScriptableImage& img = it->second;
|
||||
style().initImage();
|
||||
ScriptableImage& img = style().image;
|
||||
Context& ctx = viewer.getContext();
|
||||
ctx.setVariable(_("input"), to_script(value().value()));
|
||||
img.update(ctx);
|
||||
if (img.isReady()) {
|
||||
GeneratedImage::Options img_options(0,0, viewer.stylesheet.get(), &getSet());
|
||||
if (nativeLook()) {
|
||||
img_options.width = img_options.height = 16;
|
||||
|
||||
Reference in New Issue
Block a user