diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale
index 5070d932..8ac80d15 100644
--- a/data/en.mse-locale/locale
+++ b/data/en.mse-locale/locale
@@ -305,6 +305,38 @@ game:
# Set info
# descriptions/help text
-#stylesheet:
-# magic-new:
-#
\ No newline at end of file
+stylesheet:
+ magic-new:
+
+symbol font:
+ magic-mana-small:
+ menu item T: &Tap symbol T
+ menu item W: &White mana W
+ menu item U: Bl&ue mana U
+ menu item B: &Black mana B
+ menu item R: &Red mana R
+ menu item G: &Green mana G
+ menu item S: &Snow mana S
+ menu item X: Variable mana &X X
+ menu item Y: Variable mana &Y Y
+ menu item Z: Variable mana &Z Z
+ menu item colorless: &Colorless mana...
+ menu item half: &Half mana
+ menu item |W: &White |W
+ menu item |U: Bl&ue |U
+ menu item |B: &Black |B
+ menu item |R: &Red |R
+ menu item |G: &Green |G
+ menu item |S: &Snow |S
+ menu item 1/2: &Colorless 1/2
+ menu item hybrid: H&ybrid mana (two color)
+ menu item W/U: White/Blue mana W/U
+ menu item U/B: Blue/Black mana U/B
+ menu item B/R: Black/Ref mana B/R
+ menu item R/G: Red/Green mana R/G
+ menu item G/W: Green/White mana G/W
+ menu item W/B: White/Black mana W/B
+ menu item U/R: Blue/Red mana U/R
+ menu item B/G: Black/Green mana B/G
+ menu item R/W: Red/White mana R/W
+ menu item G/U: Green/blue mana G/U
diff --git a/data/magic-mana-large.mse-symbol-font/symbol-font b/data/magic-mana-large.mse-symbol-font/symbol-font
index 6063d429..28f924bd 100644
--- a/data/magic-mana-large.mse-symbol-font/symbol-font
+++ b/data/magic-mana-large.mse-symbol-font/symbol-font
@@ -1,4 +1,4 @@
-mse version: 0.2.7
+mse version: 0.3.0
# Symbol font in the 'popup' style, used for casting costs on modern cards
image font size: 135
@@ -7,7 +7,15 @@ symbol:
image: mana_circle.png
symbol:
code: T
- image: script: mana_t()
+ image: mana_t_older.png
+ enabled: { mana_t() == "older" }
+symbol:
+ code: T
+ image: mana_t_old.png
+ enabled: { mana_t() == "old" }
+symbol:
+ code: T
+ image: mana_t.png
symbol:
code: W/U
image: mana_wu.png
diff --git a/data/magic-mana-small.mse-symbol-font/symbol-font b/data/magic-mana-small.mse-symbol-font/symbol-font
index 54372322..016b0ee3 100644
--- a/data/magic-mana-small.mse-symbol-font/symbol-font
+++ b/data/magic-mana-small.mse-symbol-font/symbol-font
@@ -1,12 +1,12 @@
-mse version: 0.2.7
+mse version: 0.3.0
# Symbol font in the normal, flat, style, used for text boxes and on old style cards
# Note:
-# Define small_mana_t:="mana_t(_old)?.png" in the init script of the style
+# Define mana_t := {"new|old|older"} in the init script of the style
#
# So for example:
#
#init script:
-# small_mana_t := "mana_t.png"
+# mana_t := {"new"}
image font size: 135
horizontal space: 2
@@ -14,7 +14,15 @@ symbol:
image: mana_circle.png
symbol:
code: T
- image: { mana_t() }
+ image: mana_t_older.png
+ enabled: { mana_t() == "older" }
+symbol:
+ code: T
+ image: mana_t_old.png
+ enabled: { mana_t() == "old" }
+symbol:
+ code: T
+ image: mana_t.png
symbol:
code: W/U
image: mana_wu.png
@@ -102,4 +110,50 @@ text font:
text margin left: 3
text margin right: 2
text margin top: -1
-text margin bottom: -1
\ No newline at end of file
+text margin bottom: -1
+
+##############################################################
+# Insert-symbol menu
+insert symbol menu:
+ item: T
+ item:
+ type: line
+ item: X
+ item: Y
+ item: Z
+ item:
+ type: custom
+ name: colorless
+ item:
+ type: line
+ item: W
+ item: U
+ item: B
+ item: R
+ item: G
+ item: S
+ item:
+ type: line
+ item:
+ name: half
+ item: 1/2
+ item: |W
+ item: |U
+ item: |B
+ item: |R
+ item: |G
+ item: |S
+ item:
+ name: hybrid
+ item: W/U
+ item: U/B
+ item: B/R
+ item: R/G
+ item: G/W
+ item:
+ type: line
+ item: W/B
+ item: U/R
+ item: B/G
+ item: R/W
+ item: G/U
diff --git a/data/magic-new-flip.mse-style/style b/data/magic-new-flip.mse-style/style
index 2c1abe50..18a7f2ff 100644
--- a/data/magic-new-flip.mse-style/style
+++ b/data/magic-new-flip.mse-style/style
@@ -22,7 +22,7 @@ init script:
land_template := { "acard.jpg" }
# Use the normal tap symbol
- mana_t := { "mana_t.png" }
+ mana_t := { "new" }
# Does the card have a color that requires a white font for copyright/artist?
white_font_colors := filter_rule(match:"^(hybrid )?black|^land")
diff --git a/data/magic-new.mse-style/style b/data/magic-new.mse-style/style
index 4ea1945d..0a4acb70 100644
--- a/data/magic-new.mse-style/style
+++ b/data/magic-new.mse-style/style
@@ -26,9 +26,9 @@ init script:
# Use the normal tap symbol
mana_t := {
- if styling.tap_symbol == "old" then "mana_t_old.png"
- else if styling.tap_symbol == "diagonal T" then "mana_t_older.png"
- else "mana_t.png"
+ if styling.tap_symbol == "old" then "old"
+ else if styling.tap_symbol == "diagonal T" then "older"
+ else "new"
}
# Does the card have a color that requires a white font for copyright/artist?
diff --git a/data/magic-old-token.mse-style/style b/data/magic-old-token.mse-style/style
index f93f6513..b4aa8c68 100644
--- a/data/magic-old-token.mse-style/style
+++ b/data/magic-old-token.mse-style/style
@@ -23,8 +23,8 @@ init script:
# Horizontal 5 color blends are not supported
card_hybrid_5b := card_hybrid_5
- # Use the normal tap symbol
- mana_t := { "mana_t_old.png" }
+ # Use the old tap symbol
+ mana_t := { "old" }
# Does the card have a color that requires a black font for copyright/artist?
black_font_colors := filter_rule(match:"^(hybrid 2 color)?white")
diff --git a/data/magic-old.mse-style/style b/data/magic-old.mse-style/style
index 5b711fa2..3f880c6d 100644
--- a/data/magic-old.mse-style/style
+++ b/data/magic-old.mse-style/style
@@ -23,8 +23,8 @@ init script:
# Horizontal 5 color blends are not supported
card_hybrid_5b := card_hybrid_5
- # Use the normal tap symbol
- mana_t := { "mana_t_old.png" }
+ # Use the old tap symbol
+ mana_t := { "old" }
# Does the card have a color that requires a black font for copyright/artist?
black_font_colors := filter_rule(match:"^(hybrid 2 color)?white")
diff --git a/data/magic-textless.mse-style/style b/data/magic-textless.mse-style/style
index 5c3d69ba..a5538ef9 100644
--- a/data/magic-textless.mse-style/style
+++ b/data/magic-textless.mse-style/style
@@ -25,7 +25,7 @@ init script:
pt_template := { input + "pt.jpg" }
# Use the normal tap symbol
- small_mana_t := "mana_t.png"
+ mana_t := { "new" }
# Does the card have a color that requires a white font for copyright/artist?
white_font_colors := filter_rule(match:"^(hybrid 2 color)?black|^land")
diff --git a/data/vanguard-standard.mse-style/style b/data/vanguard-standard.mse-style/style
index 2a4242c9..1c9bc89b 100644
--- a/data/vanguard-standard.mse-style/style
+++ b/data/vanguard-standard.mse-style/style
@@ -9,8 +9,8 @@ icon: card-sample.png
############################################################## Extra scripts
init script:
- # Use the normal tap symbol
- small_mana_t := "mana_t.png"
+ # Use the old tap symbol
+ mana_t := { "old" }
############################################################## Set info fields
info style:
diff --git a/src/data/keyword.cpp b/src/data/keyword.cpp
index ebdcf087..d67f8ba8 100644
--- a/src/data/keyword.cpp
+++ b/src/data/keyword.cpp
@@ -21,8 +21,7 @@ IMPLEMENT_REFLECTION(KeywordMode) {
REFLECT(description);
}
IMPLEMENT_REFLECTION(KeywordExpansion) {
- REFLECT(before);
- REFLECT(after);
+ REFLECT(match);
REFLECT(reminder);
}
@@ -36,15 +35,17 @@ void read_compat(Reader& tag, Keyword* k) {
if (!separator.empty() || !parameter.empty() || !reminder.empty()) {
// old style keyword declaration, no separate expansion
KeywordExpansionP e(new KeywordExpansion);
+ e->match = k->keyword;
size_t start = separator.find_first_of('[');
size_t end = separator.find_first_of(']');
if (start != String::npos && end != String::npos) {
- e->after += separator.substr(start + 1, end - start - 1);
+ e->match += separator.substr(start + 1, end - start - 1);
}
if (!parameter.empty()) {
- e->after += _("") + parameter + _("");
+ e->match += _("") + parameter + _("");
}
e->reminder.set(reminder);
+ k->expansions.push_back(e);
}
}
diff --git a/src/data/keyword.hpp b/src/data/keyword.hpp
index 540a9126..62abb20f 100644
--- a/src/data/keyword.hpp
+++ b/src/data/keyword.hpp
@@ -46,11 +46,11 @@ class KeywordMode {
/// A way to use a keyword
class KeywordExpansion {
public:
- String before; ///< Components before the keyword: parameters and separators (tagged string)
- String after; ///< Components after the keyword: parameters and separators
+ String match; ///< String to match, tags are used for parameters
vector parameters; ///< The types of parameters
- wxRegEx splitter; ///< Regular expression to split/match the components, automatically generated
+// wxRegEx splitter; ///< Regular expression to split/match the components, automatically generated
StringScript reminder; ///< Reminder text of the keyword
+ String mode; ///< Mode of use, can be used by scripts (only gives the name). Default is the mode of the Keyword.
DECLARE_REFLECTION();
};
diff --git a/src/data/locale.cpp b/src/data/locale.cpp
index d24dc825..b9e9f410 100644
--- a/src/data/locale.cpp
+++ b/src/data/locale.cpp
@@ -7,6 +7,9 @@
// ----------------------------------------------------------------------------- : Includes
#include
+#include
+#include
+#include
#include
#include