mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Merge pull request #96 from G-e-n-e-v-e-n-s-i-S/main
Merge changes from Genevensis's fork, realign as 2.5.6
This commit is contained in:
@@ -4,15 +4,6 @@ Magic Set Editor, or MSE for short, is a program with which you can design your
|
|||||||
|
|
||||||
More information on https://magicseteditor.boards.net/
|
More information on https://magicseteditor.boards.net/
|
||||||
|
|
||||||
=======
|
|
||||||
## Main Features in the Unofficial Branch
|
|
||||||
* Fixes the "All Image" art selector list to include .jpeg images.
|
|
||||||
* Allows for the option to remove aliasing on selected art by increasing the size of the stored images in the set file.
|
|
||||||
* Adds a text filter on the style tab for Stylesheet.
|
|
||||||
* Decouples the zoom and export scales.
|
|
||||||
|
|
||||||
=======
|
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
The code depends on
|
The code depends on
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
Function: get_card_styling
|
||||||
|
|
||||||
|
--Usage--
|
||||||
|
> get_card_styling(card, set: set)
|
||||||
|
|
||||||
|
Get the styling data of a [[type:card]].
|
||||||
|
|
||||||
|
This is for use in exporter scripts. In card scripts, use the "styling" predefined variable instead.
|
||||||
|
|
||||||
|
--Parameters--
|
||||||
|
! Parameter Type Description
|
||||||
|
| @input@ [[type:card]] The card you want to retrieve the styling data from.
|
||||||
|
| @set@ [[type:set]] The set the card belongs to. In an exporter script, this can be ommited since "set" is a predefined variable.
|
||||||
|
|
||||||
|
--Examples--
|
||||||
|
> # Retrieve the value "is foil" from the card's styling options
|
||||||
|
> card_is_foil := get_card_styling(card)["is_foil"] or else false
|
||||||
@@ -97,6 +97,7 @@ These functions are built into the program, other [[type:function]]s can be defi
|
|||||||
|
|
||||||
! Cards <<<
|
! Cards <<<
|
||||||
| [[fun:new_card]] Construct a new [[type:card]] object.
|
| [[fun:new_card]] Construct a new [[type:card]] object.
|
||||||
|
| [[fun:get_card_styling]] Get the styling data of a [[type:card]].
|
||||||
|
|
||||||
! HTML export <<<
|
! HTML export <<<
|
||||||
| [[fun:to_html]] Convert [[type:tagged text]] to html.
|
| [[fun:to_html]] Convert [[type:tagged text]] to html.
|
||||||
|
|||||||
+313
-6
@@ -39,7 +39,109 @@ IMPLEMENT_REFLECTION_ENUM(ImageCombine) {
|
|||||||
VALUE_N("or", COMBINE_OR);
|
VALUE_N("or", COMBINE_OR);
|
||||||
VALUE_N("xor", COMBINE_XOR);
|
VALUE_N("xor", COMBINE_XOR);
|
||||||
VALUE_N("shadow", COMBINE_SHADOW);
|
VALUE_N("shadow", COMBINE_SHADOW);
|
||||||
VALUE_N("symmetric overlay",COMBINE_SYMMETRIC_OVERLAY);
|
VALUE_N("symmetric overlay", COMBINE_SYMMETRIC_OVERLAY);
|
||||||
|
VALUE_N("brightness to alpha", COMBINE_BRIGHTNESS_TO_ALPHA);
|
||||||
|
VALUE_N("darkness to alpha", COMBINE_DARKNESS_TO_ALPHA);
|
||||||
|
VALUE_N("greater than 5", COMBINE_GREATER_THAN_5);
|
||||||
|
VALUE_N("greater than 10", COMBINE_GREATER_THAN_10);
|
||||||
|
VALUE_N("greater than 15", COMBINE_GREATER_THAN_15);
|
||||||
|
VALUE_N("greater than 20", COMBINE_GREATER_THAN_20);
|
||||||
|
VALUE_N("greater than 25", COMBINE_GREATER_THAN_25);
|
||||||
|
VALUE_N("greater than 30", COMBINE_GREATER_THAN_30);
|
||||||
|
VALUE_N("greater than 35", COMBINE_GREATER_THAN_35);
|
||||||
|
VALUE_N("greater than 40", COMBINE_GREATER_THAN_40);
|
||||||
|
VALUE_N("greater than 45", COMBINE_GREATER_THAN_45);
|
||||||
|
VALUE_N("greater than 50", COMBINE_GREATER_THAN_50);
|
||||||
|
VALUE_N("greater than 55", COMBINE_GREATER_THAN_55);
|
||||||
|
VALUE_N("greater than 60", COMBINE_GREATER_THAN_60);
|
||||||
|
VALUE_N("greater than 65", COMBINE_GREATER_THAN_65);
|
||||||
|
VALUE_N("greater than 70", COMBINE_GREATER_THAN_70);
|
||||||
|
VALUE_N("greater than 75", COMBINE_GREATER_THAN_75);
|
||||||
|
VALUE_N("greater than 80", COMBINE_GREATER_THAN_80);
|
||||||
|
VALUE_N("greater than 85", COMBINE_GREATER_THAN_85);
|
||||||
|
VALUE_N("greater than 90", COMBINE_GREATER_THAN_90);
|
||||||
|
VALUE_N("greater than 95", COMBINE_GREATER_THAN_95);
|
||||||
|
VALUE_N("greater than 100", COMBINE_GREATER_THAN_100);
|
||||||
|
VALUE_N("greater than 105", COMBINE_GREATER_THAN_105);
|
||||||
|
VALUE_N("greater than 110", COMBINE_GREATER_THAN_110);
|
||||||
|
VALUE_N("greater than 115", COMBINE_GREATER_THAN_115);
|
||||||
|
VALUE_N("greater than 120", COMBINE_GREATER_THAN_120);
|
||||||
|
VALUE_N("greater than 125", COMBINE_GREATER_THAN_125);
|
||||||
|
VALUE_N("greater than 130", COMBINE_GREATER_THAN_130);
|
||||||
|
VALUE_N("greater than 135", COMBINE_GREATER_THAN_135);
|
||||||
|
VALUE_N("greater than 140", COMBINE_GREATER_THAN_140);
|
||||||
|
VALUE_N("greater than 145", COMBINE_GREATER_THAN_145);
|
||||||
|
VALUE_N("greater than 150", COMBINE_GREATER_THAN_150);
|
||||||
|
VALUE_N("greater than 155", COMBINE_GREATER_THAN_155);
|
||||||
|
VALUE_N("greater than 160", COMBINE_GREATER_THAN_160);
|
||||||
|
VALUE_N("greater than 165", COMBINE_GREATER_THAN_165);
|
||||||
|
VALUE_N("greater than 170", COMBINE_GREATER_THAN_170);
|
||||||
|
VALUE_N("greater than 175", COMBINE_GREATER_THAN_175);
|
||||||
|
VALUE_N("greater than 180", COMBINE_GREATER_THAN_180);
|
||||||
|
VALUE_N("greater than 185", COMBINE_GREATER_THAN_185);
|
||||||
|
VALUE_N("greater than 190", COMBINE_GREATER_THAN_190);
|
||||||
|
VALUE_N("greater than 195", COMBINE_GREATER_THAN_195);
|
||||||
|
VALUE_N("greater than 200", COMBINE_GREATER_THAN_200);
|
||||||
|
VALUE_N("greater than 205", COMBINE_GREATER_THAN_205);
|
||||||
|
VALUE_N("greater than 210", COMBINE_GREATER_THAN_210);
|
||||||
|
VALUE_N("greater than 215", COMBINE_GREATER_THAN_215);
|
||||||
|
VALUE_N("greater than 220", COMBINE_GREATER_THAN_220);
|
||||||
|
VALUE_N("greater than 225", COMBINE_GREATER_THAN_225);
|
||||||
|
VALUE_N("greater than 230", COMBINE_GREATER_THAN_230);
|
||||||
|
VALUE_N("greater than 235", COMBINE_GREATER_THAN_235);
|
||||||
|
VALUE_N("greater than 240", COMBINE_GREATER_THAN_240);
|
||||||
|
VALUE_N("greater than 245", COMBINE_GREATER_THAN_245);
|
||||||
|
VALUE_N("greater than 250", COMBINE_GREATER_THAN_250);
|
||||||
|
VALUE_N("smaller than 5", COMBINE_SMALLER_THAN_5);
|
||||||
|
VALUE_N("smaller than 10", COMBINE_SMALLER_THAN_10);
|
||||||
|
VALUE_N("smaller than 15", COMBINE_SMALLER_THAN_15);
|
||||||
|
VALUE_N("smaller than 20", COMBINE_SMALLER_THAN_20);
|
||||||
|
VALUE_N("smaller than 25", COMBINE_SMALLER_THAN_25);
|
||||||
|
VALUE_N("smaller than 30", COMBINE_SMALLER_THAN_30);
|
||||||
|
VALUE_N("smaller than 35", COMBINE_SMALLER_THAN_35);
|
||||||
|
VALUE_N("smaller than 40", COMBINE_SMALLER_THAN_40);
|
||||||
|
VALUE_N("smaller than 45", COMBINE_SMALLER_THAN_45);
|
||||||
|
VALUE_N("smaller than 50", COMBINE_SMALLER_THAN_50);
|
||||||
|
VALUE_N("smaller than 55", COMBINE_SMALLER_THAN_55);
|
||||||
|
VALUE_N("smaller than 60", COMBINE_SMALLER_THAN_60);
|
||||||
|
VALUE_N("smaller than 65", COMBINE_SMALLER_THAN_65);
|
||||||
|
VALUE_N("smaller than 70", COMBINE_SMALLER_THAN_70);
|
||||||
|
VALUE_N("smaller than 75", COMBINE_SMALLER_THAN_75);
|
||||||
|
VALUE_N("smaller than 80", COMBINE_SMALLER_THAN_80);
|
||||||
|
VALUE_N("smaller than 85", COMBINE_SMALLER_THAN_85);
|
||||||
|
VALUE_N("smaller than 90", COMBINE_SMALLER_THAN_90);
|
||||||
|
VALUE_N("smaller than 95", COMBINE_SMALLER_THAN_95);
|
||||||
|
VALUE_N("smaller than 100", COMBINE_SMALLER_THAN_100);
|
||||||
|
VALUE_N("smaller than 105", COMBINE_SMALLER_THAN_105);
|
||||||
|
VALUE_N("smaller than 110", COMBINE_SMALLER_THAN_110);
|
||||||
|
VALUE_N("smaller than 115", COMBINE_SMALLER_THAN_115);
|
||||||
|
VALUE_N("smaller than 120", COMBINE_SMALLER_THAN_120);
|
||||||
|
VALUE_N("smaller than 125", COMBINE_SMALLER_THAN_125);
|
||||||
|
VALUE_N("smaller than 130", COMBINE_SMALLER_THAN_130);
|
||||||
|
VALUE_N("smaller than 135", COMBINE_SMALLER_THAN_135);
|
||||||
|
VALUE_N("smaller than 140", COMBINE_SMALLER_THAN_140);
|
||||||
|
VALUE_N("smaller than 145", COMBINE_SMALLER_THAN_145);
|
||||||
|
VALUE_N("smaller than 150", COMBINE_SMALLER_THAN_150);
|
||||||
|
VALUE_N("smaller than 155", COMBINE_SMALLER_THAN_155);
|
||||||
|
VALUE_N("smaller than 160", COMBINE_SMALLER_THAN_160);
|
||||||
|
VALUE_N("smaller than 165", COMBINE_SMALLER_THAN_165);
|
||||||
|
VALUE_N("smaller than 170", COMBINE_SMALLER_THAN_170);
|
||||||
|
VALUE_N("smaller than 175", COMBINE_SMALLER_THAN_175);
|
||||||
|
VALUE_N("smaller than 180", COMBINE_SMALLER_THAN_180);
|
||||||
|
VALUE_N("smaller than 185", COMBINE_SMALLER_THAN_185);
|
||||||
|
VALUE_N("smaller than 190", COMBINE_SMALLER_THAN_190);
|
||||||
|
VALUE_N("smaller than 195", COMBINE_SMALLER_THAN_195);
|
||||||
|
VALUE_N("smaller than 200", COMBINE_SMALLER_THAN_200);
|
||||||
|
VALUE_N("smaller than 205", COMBINE_SMALLER_THAN_205);
|
||||||
|
VALUE_N("smaller than 210", COMBINE_SMALLER_THAN_210);
|
||||||
|
VALUE_N("smaller than 215", COMBINE_SMALLER_THAN_215);
|
||||||
|
VALUE_N("smaller than 220", COMBINE_SMALLER_THAN_220);
|
||||||
|
VALUE_N("smaller than 225", COMBINE_SMALLER_THAN_225);
|
||||||
|
VALUE_N("smaller than 230", COMBINE_SMALLER_THAN_230);
|
||||||
|
VALUE_N("smaller than 235", COMBINE_SMALLER_THAN_235);
|
||||||
|
VALUE_N("smaller than 240", COMBINE_SMALLER_THAN_240);
|
||||||
|
VALUE_N("smaller than 245", COMBINE_SMALLER_THAN_245);
|
||||||
|
VALUE_N("smaller than 250", COMBINE_SMALLER_THAN_250);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Combining functions
|
// ----------------------------------------------------------------------------- : Combining functions
|
||||||
@@ -83,7 +185,109 @@ COMBINE_FUN(COMBINE_AND, a & b)
|
|||||||
COMBINE_FUN(COMBINE_OR, a | b)
|
COMBINE_FUN(COMBINE_OR, a | b)
|
||||||
COMBINE_FUN(COMBINE_XOR, a ^ b)
|
COMBINE_FUN(COMBINE_XOR, a ^ b)
|
||||||
COMBINE_FUN(COMBINE_SHADOW, (b * a * a) / (255 * 255))
|
COMBINE_FUN(COMBINE_SHADOW, (b * a * a) / (255 * 255))
|
||||||
COMBINE_FUN(COMBINE_SYMMETRIC_OVERLAY, (Combine<COMBINE_OVERLAY>::f(a,b) + Combine<COMBINE_OVERLAY>::f(b,a)) / 2 )
|
COMBINE_FUN(COMBINE_SYMMETRIC_OVERLAY, (Combine<COMBINE_OVERLAY>::f(a, b) + Combine<COMBINE_OVERLAY>::f(b, a)) / 2)
|
||||||
|
COMBINE_FUN(COMBINE_BRIGHTNESS_TO_ALPHA, ((255 - a) * a + a * b) / 255)
|
||||||
|
COMBINE_FUN(COMBINE_DARKNESS_TO_ALPHA, (255 * a + (255 - a) * b) / 255)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_5, a > 5 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_10, a > 10 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_15, a > 15 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_20, a > 20 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_25, a > 25 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_30, a > 30 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_35, a > 35 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_40, a > 40 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_45, a > 45 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_50, a > 50 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_55, a > 55 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_60, a > 60 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_65, a > 65 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_70, a > 70 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_75, a > 75 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_80, a > 80 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_85, a > 85 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_90, a > 90 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_95, a > 95 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_100, a > 100 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_105, a > 105 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_110, a > 110 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_115, a > 115 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_120, a > 120 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_125, a > 125 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_130, a > 130 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_135, a > 135 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_140, a > 140 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_145, a > 145 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_150, a > 150 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_155, a > 155 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_160, a > 160 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_165, a > 165 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_170, a > 170 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_175, a > 175 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_180, a > 180 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_185, a > 185 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_190, a > 190 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_195, a > 195 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_200, a > 200 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_205, a > 205 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_210, a > 210 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_215, a > 215 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_220, a > 220 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_225, a > 225 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_230, a > 230 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_235, a > 235 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_240, a > 240 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_245, a > 245 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_GREATER_THAN_250, a > 250 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_5, a < 5 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_10, a < 10 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_15, a < 15 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_20, a < 20 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_25, a < 25 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_30, a < 30 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_35, a < 35 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_40, a < 40 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_45, a < 45 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_50, a < 50 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_55, a < 55 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_60, a < 60 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_65, a < 65 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_70, a < 70 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_75, a < 75 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_80, a < 80 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_85, a < 85 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_90, a < 90 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_95, a < 95 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_100, a < 100 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_105, a < 105 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_110, a < 110 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_115, a < 115 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_120, a < 120 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_125, a < 125 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_130, a < 130 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_135, a < 135 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_140, a < 140 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_145, a < 145 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_150, a < 150 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_155, a < 155 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_160, a < 160 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_165, a < 165 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_170, a < 170 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_175, a < 175 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_180, a < 180 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_185, a < 185 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_190, a < 190 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_195, a < 195 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_200, a < 200 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_205, a < 205 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_210, a < 210 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_215, a < 215 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_220, a < 220 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_225, a < 225 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_230, a < 230 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_235, a < 235 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_240, a < 240 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_245, a < 245 ? b : a)
|
||||||
|
COMBINE_FUN(COMBINE_SMALLER_THAN_250, a < 250 ? b : a)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Combining
|
// ----------------------------------------------------------------------------- : Combining
|
||||||
|
|
||||||
@@ -92,17 +296,18 @@ COMBINE_FUN(COMBINE_SYMMETRIC_OVERLAY, (Combine<COMBINE_OVERLAY>::f(a,b) + Combi
|
|||||||
template <ImageCombine combine>
|
template <ImageCombine combine>
|
||||||
void combine_image_do(Image& a, Image b) {
|
void combine_image_do(Image& a, Image b) {
|
||||||
UInt size = a.GetWidth() * a.GetHeight() * 3;
|
UInt size = a.GetWidth() * a.GetHeight() * 3;
|
||||||
Byte *dataA = a.GetData(), *dataB = b.GetData();
|
Byte* dataA = a.GetData(), * dataB = b.GetData();
|
||||||
// for each pixel: apply function
|
// for each pixel: apply function
|
||||||
for (UInt i = 0 ; i < size ; ++i) {
|
for (UInt i = 0; i < size; ++i) {
|
||||||
dataA[i] = Combine<combine>::f(dataA[i], dataB[i]);
|
dataA[i] = Combine<combine>::f(dataA[i], dataB[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void combine_image(Image& a, const Image& b, ImageCombine combine) {
|
void combine_image(Image& a, const Image& b, ImageCombine combine) {
|
||||||
// Images must have same size
|
// Images must have same size
|
||||||
assert(a.GetWidth() == b.GetWidth());
|
if (a.GetWidth() != b.GetWidth() || a.GetHeight() != b.GetHeight()) {
|
||||||
assert(a.GetHeight() == b.GetHeight());
|
throw Error(_ERROR_("images used for combine blending must have the same size"));
|
||||||
|
}
|
||||||
// Copy alpha channel?
|
// Copy alpha channel?
|
||||||
if (b.HasAlpha()) {
|
if (b.HasAlpha()) {
|
||||||
if (!a.HasAlpha()) a.InitAlpha();
|
if (!a.HasAlpha()) a.InitAlpha();
|
||||||
@@ -136,6 +341,108 @@ void combine_image(Image& a, const Image& b, ImageCombine combine) {
|
|||||||
DISPATCH(COMBINE_XOR);
|
DISPATCH(COMBINE_XOR);
|
||||||
DISPATCH(COMBINE_SHADOW);
|
DISPATCH(COMBINE_SHADOW);
|
||||||
DISPATCH(COMBINE_SYMMETRIC_OVERLAY);
|
DISPATCH(COMBINE_SYMMETRIC_OVERLAY);
|
||||||
|
DISPATCH(COMBINE_BRIGHTNESS_TO_ALPHA);
|
||||||
|
DISPATCH(COMBINE_DARKNESS_TO_ALPHA);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_5);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_10);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_15);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_20);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_25);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_30);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_35);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_40);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_45);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_50);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_55);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_60);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_65);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_70);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_75);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_80);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_85);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_90);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_95);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_100);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_105);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_110);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_115);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_120);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_125);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_130);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_135);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_140);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_145);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_150);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_155);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_160);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_165);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_170);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_175);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_180);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_185);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_190);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_195);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_200);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_205);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_210);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_215);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_220);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_225);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_230);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_235);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_240);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_245);
|
||||||
|
DISPATCH(COMBINE_GREATER_THAN_250);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_5);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_10);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_15);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_20);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_25);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_30);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_35);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_40);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_45);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_50);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_55);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_60);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_65);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_70);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_75);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_80);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_85);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_90);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_95);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_100);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_105);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_110);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_115);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_120);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_125);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_130);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_135);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_140);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_145);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_150);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_155);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_160);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_165);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_170);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_175);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_180);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_185);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_190);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_195);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_200);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_205);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_210);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_215);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_220);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_225);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_230);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_235);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_240);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_245);
|
||||||
|
DISPATCH(COMBINE_SMALLER_THAN_250);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+102
@@ -121,6 +121,108 @@ enum ImageCombine
|
|||||||
, COMBINE_XOR
|
, COMBINE_XOR
|
||||||
, COMBINE_SHADOW
|
, COMBINE_SHADOW
|
||||||
, COMBINE_SYMMETRIC_OVERLAY
|
, COMBINE_SYMMETRIC_OVERLAY
|
||||||
|
, COMBINE_BRIGHTNESS_TO_ALPHA
|
||||||
|
, COMBINE_DARKNESS_TO_ALPHA
|
||||||
|
, COMBINE_GREATER_THAN_5
|
||||||
|
, COMBINE_GREATER_THAN_10
|
||||||
|
, COMBINE_GREATER_THAN_15
|
||||||
|
, COMBINE_GREATER_THAN_20
|
||||||
|
, COMBINE_GREATER_THAN_25
|
||||||
|
, COMBINE_GREATER_THAN_30
|
||||||
|
, COMBINE_GREATER_THAN_35
|
||||||
|
, COMBINE_GREATER_THAN_40
|
||||||
|
, COMBINE_GREATER_THAN_45
|
||||||
|
, COMBINE_GREATER_THAN_50
|
||||||
|
, COMBINE_GREATER_THAN_55
|
||||||
|
, COMBINE_GREATER_THAN_60
|
||||||
|
, COMBINE_GREATER_THAN_65
|
||||||
|
, COMBINE_GREATER_THAN_70
|
||||||
|
, COMBINE_GREATER_THAN_75
|
||||||
|
, COMBINE_GREATER_THAN_80
|
||||||
|
, COMBINE_GREATER_THAN_85
|
||||||
|
, COMBINE_GREATER_THAN_90
|
||||||
|
, COMBINE_GREATER_THAN_95
|
||||||
|
, COMBINE_GREATER_THAN_100
|
||||||
|
, COMBINE_GREATER_THAN_105
|
||||||
|
, COMBINE_GREATER_THAN_110
|
||||||
|
, COMBINE_GREATER_THAN_115
|
||||||
|
, COMBINE_GREATER_THAN_120
|
||||||
|
, COMBINE_GREATER_THAN_125
|
||||||
|
, COMBINE_GREATER_THAN_130
|
||||||
|
, COMBINE_GREATER_THAN_135
|
||||||
|
, COMBINE_GREATER_THAN_140
|
||||||
|
, COMBINE_GREATER_THAN_145
|
||||||
|
, COMBINE_GREATER_THAN_150
|
||||||
|
, COMBINE_GREATER_THAN_155
|
||||||
|
, COMBINE_GREATER_THAN_160
|
||||||
|
, COMBINE_GREATER_THAN_165
|
||||||
|
, COMBINE_GREATER_THAN_170
|
||||||
|
, COMBINE_GREATER_THAN_175
|
||||||
|
, COMBINE_GREATER_THAN_180
|
||||||
|
, COMBINE_GREATER_THAN_185
|
||||||
|
, COMBINE_GREATER_THAN_190
|
||||||
|
, COMBINE_GREATER_THAN_195
|
||||||
|
, COMBINE_GREATER_THAN_200
|
||||||
|
, COMBINE_GREATER_THAN_205
|
||||||
|
, COMBINE_GREATER_THAN_210
|
||||||
|
, COMBINE_GREATER_THAN_215
|
||||||
|
, COMBINE_GREATER_THAN_220
|
||||||
|
, COMBINE_GREATER_THAN_225
|
||||||
|
, COMBINE_GREATER_THAN_230
|
||||||
|
, COMBINE_GREATER_THAN_235
|
||||||
|
, COMBINE_GREATER_THAN_240
|
||||||
|
, COMBINE_GREATER_THAN_245
|
||||||
|
, COMBINE_GREATER_THAN_250
|
||||||
|
, COMBINE_SMALLER_THAN_5
|
||||||
|
, COMBINE_SMALLER_THAN_10
|
||||||
|
, COMBINE_SMALLER_THAN_15
|
||||||
|
, COMBINE_SMALLER_THAN_20
|
||||||
|
, COMBINE_SMALLER_THAN_25
|
||||||
|
, COMBINE_SMALLER_THAN_30
|
||||||
|
, COMBINE_SMALLER_THAN_35
|
||||||
|
, COMBINE_SMALLER_THAN_40
|
||||||
|
, COMBINE_SMALLER_THAN_45
|
||||||
|
, COMBINE_SMALLER_THAN_50
|
||||||
|
, COMBINE_SMALLER_THAN_55
|
||||||
|
, COMBINE_SMALLER_THAN_60
|
||||||
|
, COMBINE_SMALLER_THAN_65
|
||||||
|
, COMBINE_SMALLER_THAN_70
|
||||||
|
, COMBINE_SMALLER_THAN_75
|
||||||
|
, COMBINE_SMALLER_THAN_80
|
||||||
|
, COMBINE_SMALLER_THAN_85
|
||||||
|
, COMBINE_SMALLER_THAN_90
|
||||||
|
, COMBINE_SMALLER_THAN_95
|
||||||
|
, COMBINE_SMALLER_THAN_100
|
||||||
|
, COMBINE_SMALLER_THAN_105
|
||||||
|
, COMBINE_SMALLER_THAN_110
|
||||||
|
, COMBINE_SMALLER_THAN_115
|
||||||
|
, COMBINE_SMALLER_THAN_120
|
||||||
|
, COMBINE_SMALLER_THAN_125
|
||||||
|
, COMBINE_SMALLER_THAN_130
|
||||||
|
, COMBINE_SMALLER_THAN_135
|
||||||
|
, COMBINE_SMALLER_THAN_140
|
||||||
|
, COMBINE_SMALLER_THAN_145
|
||||||
|
, COMBINE_SMALLER_THAN_150
|
||||||
|
, COMBINE_SMALLER_THAN_155
|
||||||
|
, COMBINE_SMALLER_THAN_160
|
||||||
|
, COMBINE_SMALLER_THAN_165
|
||||||
|
, COMBINE_SMALLER_THAN_170
|
||||||
|
, COMBINE_SMALLER_THAN_175
|
||||||
|
, COMBINE_SMALLER_THAN_180
|
||||||
|
, COMBINE_SMALLER_THAN_185
|
||||||
|
, COMBINE_SMALLER_THAN_190
|
||||||
|
, COMBINE_SMALLER_THAN_195
|
||||||
|
, COMBINE_SMALLER_THAN_200
|
||||||
|
, COMBINE_SMALLER_THAN_205
|
||||||
|
, COMBINE_SMALLER_THAN_210
|
||||||
|
, COMBINE_SMALLER_THAN_215
|
||||||
|
, COMBINE_SMALLER_THAN_220
|
||||||
|
, COMBINE_SMALLER_THAN_225
|
||||||
|
, COMBINE_SMALLER_THAN_230
|
||||||
|
, COMBINE_SMALLER_THAN_235
|
||||||
|
, COMBINE_SMALLER_THAN_240
|
||||||
|
, COMBINE_SMALLER_THAN_245
|
||||||
|
, COMBINE_SMALLER_THAN_250
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Combine image b onto image a using some combining function.
|
/// Combine image b onto image a using some combining function.
|
||||||
|
|||||||
@@ -227,14 +227,14 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
|
|||||||
non_normal_export->SetValue(!settings.default_stylesheet_settings.card_normal_export());
|
non_normal_export->SetValue(!settings.default_stylesheet_settings.card_normal_export());
|
||||||
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
|
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
|
||||||
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
|
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
|
||||||
int choices[] = { 50,66,75,100,120,150,200 };
|
int choices[] = { 50,66,75,100,120,150,175,200 };
|
||||||
for (unsigned int i = 0 ; i < sizeof(choices)/sizeof(choices[0]) ; ++i) {
|
for (unsigned int i = 0 ; i < sizeof(choices)/sizeof(choices[0]) ; ++i) {
|
||||||
zoom->Append(String::Format(_("%d%%"),choices[i]));
|
zoom->Append(String::Format(_("%d%%"),choices[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
export_zoom_int = static_cast<int>(settings.default_stylesheet_settings.export_zoom() * 100);
|
export_zoom_int = static_cast<int>(settings.default_stylesheet_settings.export_zoom() * 100);
|
||||||
export_zoom->SetValue(String::Format(_("%d%%"), export_zoom_int));
|
export_zoom->SetValue(String::Format(_("%d%%"), export_zoom_int));
|
||||||
int export_choices[] = { 50,66,75,100,120,150,200 };
|
int export_choices[] = { 50,66,75,100,120,150,175,200 };
|
||||||
for (unsigned int i = 0; i < sizeof(export_choices) / sizeof(export_choices[0]); ++i) {
|
for (unsigned int i = 0; i < sizeof(export_choices) / sizeof(export_choices[0]); ++i) {
|
||||||
export_zoom->Append(String::Format(_("%d%%"), export_choices[i]));
|
export_zoom->Append(String::Format(_("%d%%"), export_choices[i]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ bool prepare_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& styl
|
|||||||
img.generateCached(img_options, &style.mask, &combine, &bitmap, &image, &size);
|
img.generateCached(img_options, &style.mask, &combine, &bitmap, &image, &size);
|
||||||
// store content properties
|
// store content properties
|
||||||
if (style.content_width != size.width || style.content_height != size.height) {
|
if (style.content_width != size.width || style.content_height != size.height) {
|
||||||
style.content_width = size.width;
|
style.content_width = size.width / dc.getZoom();
|
||||||
style.content_height = size.height;
|
style.content_height = size.height / dc.getZoom();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ void ImageValueViewer::draw(RotatedDC& dc) {
|
|||||||
if (!image.Ok() && style().default_image.isReady()) {
|
if (!image.Ok() && style().default_image.isReady()) {
|
||||||
image = style().default_image.generate(GeneratedImage::Options(w, h, &getStylePackage(), &getLocalPackage()));
|
image = style().default_image.generate(GeneratedImage::Options(w, h, &getStylePackage(), &getLocalPackage()));
|
||||||
is_default = true;
|
is_default = true;
|
||||||
if (what & DRAW_EDITING) {
|
if ((what & DRAW_EDITING) && field().editable) {
|
||||||
bitmap = imagePlaceholder(dc, w, h, image, what & DRAW_EDITING);
|
bitmap = imagePlaceholder(dc, w, h, image, true);
|
||||||
if (alpha_mask.isLoaded() || !is_rad0(a)) {
|
if (alpha_mask.isLoaded() || !is_rad0(a)) {
|
||||||
image = bitmap.ConvertToImage(); // we need to convert back to an image
|
image = bitmap.ConvertToImage(); // we need to convert back to an image
|
||||||
} else {
|
} else {
|
||||||
@@ -54,7 +54,7 @@ void ImageValueViewer::draw(RotatedDC& dc) {
|
|||||||
// checkerboard placeholder
|
// checkerboard placeholder
|
||||||
if (!image.Ok() && !bitmap.Ok() && style().width > 40) {
|
if (!image.Ok() && !bitmap.Ok() && style().width > 40) {
|
||||||
// placeholder bitmap
|
// placeholder bitmap
|
||||||
bitmap = imagePlaceholder(dc, w, h, wxNullImage, what & DRAW_EDITING);
|
bitmap = imagePlaceholder(dc, w, h, wxNullImage, (what & DRAW_EDITING) && field().editable);
|
||||||
if (alpha_mask.isLoaded() || !is_rad0(a)) {
|
if (alpha_mask.isLoaded() || !is_rad0(a)) {
|
||||||
// we need to convert back to an image
|
// we need to convert back to an image
|
||||||
image = bitmap.ConvertToImage();
|
image = bitmap.ConvertToImage();
|
||||||
|
|||||||
@@ -34,7 +34,16 @@ void InfoValueViewer::draw(RotatedDC& dc) {
|
|||||||
style().padding_top,
|
style().padding_top,
|
||||||
-style().padding_left - style().padding_right,
|
-style().padding_left - style().padding_right,
|
||||||
-style().padding_top - style().padding_bottom
|
-style().padding_top - style().padding_bottom
|
||||||
);
|
);
|
||||||
RealSize size = dc.GetTextExtent(value().value);
|
// for some reason, while inside the style tab, this value is empty
|
||||||
dc.DrawText(value().value, align_in_rect(style().alignment, size, rect));
|
// so as a hack for now, if the value is empty, go fetch the caption instead
|
||||||
|
if (value().value.empty()) {
|
||||||
|
RealSize size = dc.GetTextExtent(field().caption.get());
|
||||||
|
dc.DrawText(field().caption.get(), align_in_rect(style().alignment, size, rect));
|
||||||
|
}
|
||||||
|
// this is what should happen
|
||||||
|
else {
|
||||||
|
RealSize size = dc.GetTextExtent(value().value);
|
||||||
|
dc.DrawText(value().value, align_in_rect(style().alignment, size, rect));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -669,6 +669,17 @@ SCRIPT_FUNCTION(random_select_many) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCRIPT_FUNCTION(get_card_styling) {
|
||||||
|
SCRIPT_PARAM_C(ScriptValueP, input);
|
||||||
|
SCRIPT_PARAM_C(ScriptValueP, set);
|
||||||
|
ScriptObject<CardP>* c = dynamic_cast<ScriptObject<CardP>*>(input.get());
|
||||||
|
ScriptObject<Set*>* s = dynamic_cast<ScriptObject<Set*>*>(set.get());
|
||||||
|
if (s && c) {
|
||||||
|
return to_script(&s->getValue()->stylingDataFor(c->getValue()));
|
||||||
|
}
|
||||||
|
throw ScriptError(_("invalid set or card argument"));
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Keywords
|
// ----------------------------------------------------------------------------- : Keywords
|
||||||
|
|
||||||
|
|
||||||
@@ -755,7 +766,8 @@ void init_script_basic_functions(Context& ctx) {
|
|||||||
ctx.setVariable(_("to_color"), script_to_color);
|
ctx.setVariable(_("to_color"), script_to_color);
|
||||||
ctx.setVariable(_("to_date"), script_to_date);
|
ctx.setVariable(_("to_date"), script_to_date);
|
||||||
ctx.setVariable(_("to_code"), script_to_code);
|
ctx.setVariable(_("to_code"), script_to_code);
|
||||||
ctx.setVariable(_("type_name"), script_type_name);
|
ctx.setVariable(_("type_name"), script_type_name);
|
||||||
|
ctx.setVariable(_("get_card_styling"), script_get_card_styling);
|
||||||
// math
|
// math
|
||||||
ctx.setVariable(_("abs"), script_abs);
|
ctx.setVariable(_("abs"), script_abs);
|
||||||
ctx.setVariable(_("random_real"), script_random_real);
|
ctx.setVariable(_("random_real"), script_random_real);
|
||||||
|
|||||||
@@ -47,14 +47,16 @@ SCRIPT_FUNCTION(to_card_image) {
|
|||||||
// ----------------------------------------------------------------------------- : Image functions
|
// ----------------------------------------------------------------------------- : Image functions
|
||||||
|
|
||||||
SCRIPT_FUNCTION(width_of) {
|
SCRIPT_FUNCTION(width_of) {
|
||||||
|
SCRIPT_PARAM(Set*, set);
|
||||||
SCRIPT_PARAM(GeneratedImageP, input);
|
SCRIPT_PARAM(GeneratedImageP, input);
|
||||||
Image image = input->generate(GeneratedImage::Options());
|
Image image = input->generate(GeneratedImage::Options(0, 0, set->stylesheet.get()));
|
||||||
SCRIPT_RETURN(image.GetWidth());
|
SCRIPT_RETURN(image.GetWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
SCRIPT_FUNCTION(height_of) {
|
SCRIPT_FUNCTION(height_of) {
|
||||||
|
SCRIPT_PARAM(Set*, set);
|
||||||
SCRIPT_PARAM(GeneratedImageP, input);
|
SCRIPT_PARAM(GeneratedImageP, input);
|
||||||
Image image = input->generate(GeneratedImage::Options());
|
Image image = input->generate(GeneratedImage::Options(0, 0, set->stylesheet.get()));
|
||||||
SCRIPT_RETURN(image.GetHeight());
|
SCRIPT_RETURN(image.GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ bool isOper (wxUniChar c) { return wxStrchr(_("+-*/!.@%^&:=<>;,"),c) != nullptr
|
|||||||
bool isLparen(wxUniChar c) { return c==_('(') || c==_('[') || c==_('{'); }
|
bool isLparen(wxUniChar c) { return c==_('(') || c==_('[') || c==_('{'); }
|
||||||
bool isRparen(wxUniChar c) { return c==_(')') || c==_(']') || c==_('}'); }
|
bool isRparen(wxUniChar c) { return c==_(')') || c==_(']') || c==_('}'); }
|
||||||
bool isDigitOrDot(wxUniChar c) { return isDigit(c) || c==_('.'); }
|
bool isDigitOrDot(wxUniChar c) { return isDigit(c) || c==_('.'); }
|
||||||
bool isLongOper(StringView s) { return s==_(":=") || s==_("==") || s==_("!=") || s==_("<=") || s==_(">="); }
|
bool isLongOper(StringView s) { return s==_(":=") || s==_("==") || s==_("!=") || s==_("<=") || s==_(">=") || s==_("->"); }
|
||||||
|
|
||||||
// moveme
|
// moveme
|
||||||
// ----------------------------------------------------------------------------- : Tokenizing
|
// ----------------------------------------------------------------------------- : Tokenizing
|
||||||
@@ -351,7 +351,7 @@ enum Precedence
|
|||||||
{ PREC_ALL
|
{ PREC_ALL
|
||||||
, PREC_NEWLINE // newline ;
|
, PREC_NEWLINE // newline ;
|
||||||
, PREC_SEQ // ;
|
, PREC_SEQ // ;
|
||||||
, PREC_SET // :=
|
, PREC_SET // := ->
|
||||||
, PREC_AND // and or
|
, PREC_AND // and or
|
||||||
, PREC_CMP // == != < > <= >=
|
, PREC_CMP // == != < > <= >=
|
||||||
, PREC_ADD // + -
|
, PREC_ADD // + -
|
||||||
@@ -736,7 +736,7 @@ ExprType parseOper(TokenIterator& input, Script& script, Precedence minPrec, Ins
|
|||||||
}
|
}
|
||||||
script.addInstruction(I_POP); // discard result of first expression
|
script.addInstruction(I_POP); // discard result of first expression
|
||||||
type = parseOper(input, script, PREC_SET);
|
type = parseOper(input, script, PREC_SET);
|
||||||
} else if (minPrec <= PREC_SET && token==_(":=")) {
|
} else if (minPrec <= PREC_SET && (token==_(":=") || token==_("->"))) {
|
||||||
// We made a mistake, the part before the := should be a variable name,
|
// We made a mistake, the part before the := should be a variable name,
|
||||||
// not an expression. Remove that instruction.
|
// not an expression. Remove that instruction.
|
||||||
Instruction& instr = script.getInstructions().back();
|
Instruction& instr = script.getInstructions().back();
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ $built_in_functions = array(
|
|||||||
'filter_list' =>'',
|
'filter_list' =>'',
|
||||||
'random_shuffle' =>'',
|
'random_shuffle' =>'',
|
||||||
'random_select' =>'',
|
'random_select' =>'',
|
||||||
'random_select_many' =>'',
|
'random_select_many' =>'',
|
||||||
|
'get_card_styling' =>'',
|
||||||
// keywords
|
// keywords
|
||||||
'expand_keywords' =>'', 'expand_keywords_rule'=>'expand_keywords',
|
'expand_keywords' =>'', 'expand_keywords_rule'=>'expand_keywords',
|
||||||
'keyword_usage' =>'',
|
'keyword_usage' =>'',
|
||||||
|
|||||||
Reference in New Issue
Block a user