Commit e1e6d9fd authored by twanvl's avatar twanvl

Nicer colors for card list/stats panel;

Keywords updated so <name><cost> splits correctly
parent 5aadb4ed
...@@ -297,17 +297,137 @@ choice colors: ...@@ -297,17 +297,137 @@ choice colors:
hybrid vertical black / artifact : rgb(243,26,136) hybrid vertical black / artifact : rgb(243,26,136)
hybrid vertical red / artifact : rgb(243,26,136) hybrid vertical red / artifact : rgb(243,26,136)
hybrid vertical green / artifact : rgb(243,26,136) hybrid vertical green / artifact : rgb(243,26,136)
# TODO : Add the rest
# ... and for the card list # ... and for the card list
choice colors cardlist: choice colors cardlist:
white : rgb(130,130,110) white : rgb(156,134,90)
blue : rgb(0,64,168) blue : rgb(0,64,168)
black : rgb(0,0,0) black : rgb(0,0,0)
red : rgb(168,0,0) red : rgb(168,0,0)
green : rgb(0,168,0) green : rgb(0,168,0)
colorless : rgb(72,90,100) colorless : rgb(119,83,83)
artifact : rgb(72,90,100) artifact : rgb(72,90,100)
multicolor : rgb(120,120,0) multicolor : rgb(120,120,0)
land : rgb(84,84,60) land : rgb(109,62,39)
# Sub menus, same colors
multicolor 2 color white / blue : rgb(120,120,0)
multicolor 2 color blue / black : rgb(120,120,0)
multicolor 2 color black / red : rgb(120,120,0)
multicolor 2 color red / green : rgb(120,120,0)
multicolor 2 color green / white : rgb(120,120,0)
multicolor 2 color white / black : rgb(120,120,0)
multicolor 2 color blue / red : rgb(120,120,0)
multicolor 2 color black / green : rgb(120,120,0)
multicolor 2 color red / white : rgb(120,120,0)
multicolor 2 color green / blue : rgb(120,120,0)
multicolor 3 color white / blue / black : rgb(120,120,0)
multicolor 3 color blue / black / red : rgb(120,120,0)
multicolor 3 color black / red / green : rgb(120,120,0)
multicolor 3 color red / green / white : rgb(120,120,0)
multicolor 3 color green / white / blue : rgb(120,120,0)
multicolor 3 color white / black / red : rgb(120,120,0)
multicolor 3 color blue / red / green : rgb(120,120,0)
multicolor 3 color black / green / white : rgb(120,120,0)
multicolor 3 color red / white / blue : rgb(120,120,0)
multicolor 3 color green / blue / black : rgb(120,120,0)
multicolor 4 color white / blue / black / red : rgb(120,120,0)
multicolor 4 color blue / black / red / green : rgb(120,120,0)
multicolor 4 color black / red / green / white : rgb(120,120,0)
multicolor 4 color red / green / white / blue : rgb(120,120,0)
multicolor 4 color green / white / blue / black : rgb(120,120,0)
multicolor 5 color white / blue / black / red / green : rgb(120,120,0)
multicolor 5 color horizontal white / blue / black / red / green: rgb(120,120,0)
land 1 color white : rgb(109,62,39)
land 1 color blue : rgb(109,62,39)
land 1 color black : rgb(109,62,39)
land 1 color red : rgb(109,62,39)
land 1 color green : rgb(109,62,39)
land 1 color multicolor : rgb(109,62,39)
land 2 color white / blue : rgb(109,62,39)
land 2 color blue / black : rgb(109,62,39)
land 2 color black / red : rgb(109,62,39)
land 2 color red / green : rgb(109,62,39)
land 2 color green / white : rgb(109,62,39)
land 2 color white / black : rgb(109,62,39)
land 2 color blue / red : rgb(109,62,39)
land 2 color black / green : rgb(109,62,39)
land 2 color red / white : rgb(109,62,39)
land 2 color green / blue : rgb(109,62,39)
hybrid 2 color white / blue : rgb(115,0,160) # purple
hybrid 2 color blue / black : rgb(115,0,160)
hybrid 2 color black / red : rgb(115,0,160)
hybrid 2 color red / green : rgb(115,0,160)
hybrid 2 color green / white : rgb(115,0,160)
hybrid 2 color white / black : rgb(115,0,160)
hybrid 2 color blue / red : rgb(115,0,160)
hybrid 2 color black / green : rgb(115,0,160)
hybrid 2 color red / white : rgb(115,0,160)
hybrid 2 color green / blue : rgb(115,0,160)
hybrid 2 color artifact / white : rgb(115,0,160)
hybrid 2 color artifact / blue : rgb(115,0,160)
hybrid 2 color artifact / black : rgb(115,0,160)
hybrid 2 color artifact / red : rgb(115,0,160)
hybrid 2 color artifact / green : rgb(115,0,160)
hybrid 3 color white / blue / black : rgb(115,0,160)
hybrid 3 color blue / black / red : rgb(115,0,160)
hybrid 3 color black / red / green : rgb(115,0,160)
hybrid 3 color red / green / white : rgb(115,0,160)
hybrid 3 color green / white / blue : rgb(115,0,160)
hybrid 3 color white / black / red : rgb(115,0,160)
hybrid 3 color blue / red / green : rgb(115,0,160)
hybrid 3 color black / green / white : rgb(115,0,160)
hybrid 3 color red / white / blue : rgb(115,0,160)
hybrid 3 color green / blue / black : rgb(115,0,160)
hybrid 3 color horizontal white / blue / black : rgb(115,0,160)
hybrid 3 color horizontal blue / black / red : rgb(115,0,160)
hybrid 3 color horizontal black / red / green : rgb(115,0,160)
hybrid 3 color horizontal red / green / white : rgb(115,0,160)
hybrid 3 color horizontal green / white / blue : rgb(115,0,160)
hybrid 3 color horizontal white / black / red : rgb(115,0,160)
hybrid 3 color horizontal blue / red / green : rgb(115,0,160)
hybrid 3 color horizontal black / green / white : rgb(115,0,160)
hybrid 3 color horizontal red / white / blue : rgb(115,0,160)
hybrid 3 color horizontal green / blue / black : rgb(115,0,160)
hybrid 4 color white / blue / black / red : rgb(115,0,160)
hybrid 4 color blue / black / red / green : rgb(115,0,160)
hybrid 4 color black / red / green / white : rgb(115,0,160)
hybrid 4 color red / green / white / blue : rgb(115,0,160)
hybrid 4 color green / white / blue / black : rgb(115,0,160)
hybrid 4 color horizontal white / blue / black / red : rgb(115,0,160)
hybrid 4 color horizontal blue / black / red / green : rgb(115,0,160)
hybrid 4 color horizontal black / red / green / white : rgb(115,0,160)
hybrid 4 color horizontal red / green / white / blue : rgb(115,0,160)
hybrid 4 color horizontal green / white / blue / black : rgb(115,0,160)
hybrid 5 color white / blue / black / red / green : rgb(115,0,160)
hybrid 5 color horizontal white / blue / black / red / green : rgb(115,0,160)
hybrid vertical white / blue : rgb(115,0,160)
hybrid vertical white / black : rgb(115,0,160)
hybrid vertical white / red : rgb(115,0,160)
hybrid vertical white / green : rgb(115,0,160)
hybrid vertical blue / white : rgb(115,0,160)
hybrid vertical blue / black : rgb(115,0,160)
hybrid vertical blue / red : rgb(115,0,160)
hybrid vertical blue / green : rgb(115,0,160)
hybrid vertical black / white : rgb(115,0,160)
hybrid vertical black / blue : rgb(115,0,160)
hybrid vertical black / red : rgb(115,0,160)
hybrid vertical black / green : rgb(115,0,160)
hybrid vertical red / white : rgb(115,0,160)
hybrid vertical red / blue : rgb(115,0,160)
hybrid vertical red / black : rgb(115,0,160)
hybrid vertical red / green : rgb(115,0,160)
hybrid vertical green / white : rgb(115,0,160)
hybrid vertical green / blue : rgb(115,0,160)
hybrid vertical green / red : rgb(115,0,160)
hybrid vertical green / black : rgb(115,0,160)
hybrid vertical artifact / white : rgb(115,0,160)
hybrid vertical artifact / blue : rgb(115,0,160)
hybrid vertical artifact / black : rgb(115,0,160)
hybrid vertical artifact / red : rgb(115,0,160)
hybrid vertical artifact / green : rgb(115,0,160)
hybrid vertical white / artifact : rgb(115,0,160)
hybrid vertical blue / artifact : rgb(115,0,160)
hybrid vertical black / artifact : rgb(115,0,160)
hybrid vertical red / artifact : rgb(115,0,160)
hybrid vertical green / artifact : rgb(115,0,160)
# TODO : Add the rest # TODO : Add the rest
...@@ -157,7 +157,7 @@ init script: ...@@ -157,7 +157,7 @@ init script:
if input.separator_before == "—" then if input.separator_before == "—" then
"<param-cost>{input.param}</param-cost>" "<param-cost>{input.param}</param-cost>"
else else
"<param-mana>{add}{input.param}</param-mana>" "{add}<param-mana>{input.param}</param-mana>"
} }
alternative_cost := replace_rule(match:"^[A-Z]", replace: { to_lower() }) alternative_cost := replace_rule(match:"^[A-Z]", replace: { to_lower() })
format_alt_cost := { format_alt_cost := {
...@@ -184,7 +184,7 @@ init script: ...@@ -184,7 +184,7 @@ init script:
|adds?|pay(ed)?[ ](with|using) |adds?|pay(ed)?[ ](with|using)
) )
([ ]either)? # pay either X or Y ([ ]either)? # pay either X or Y
([ ]<sym[^>]*>[STXYZWUBRG0-9/|]+</sym[^>]*>[ ](and|or))* # pay X or Y ([ ]<sym[^>]*>[STXYZWUBRG0-9/|]+</sym[^>]*>[ ](and|or|and/or))* # pay X or Y
[ ]<match> [ ]<match>
([,.)]|$ # (end of word) ([,.)]|$ # (end of word)
|[ ][^ .,]*$ # still typing... |[ ][^ .,]*$ # still typing...
...@@ -639,8 +639,8 @@ card field: ...@@ -639,8 +639,8 @@ card field:
basic land: rgb(109,62,39) basic land: rgb(109,62,39)
common: rgb(33,33,33) common: rgb(33,33,33)
uncommon: rgb(224,224,224) uncommon: rgb(224,224,224)
rare: rgb(214,196,94) rare: rgb(255,207,52)
special: rgb(58,7,80) special: rgb(190,0,255)
############################# Text box ############################# Text box
card field: card field:
...@@ -979,6 +979,16 @@ statistics dimension: ...@@ -979,6 +979,16 @@ statistics dimension:
multicolor : rgb(255,188,14) multicolor : rgb(255,188,14)
land : rgb(109,62,39) land : rgb(109,62,39)
hybrid : rgb(243,26,136) hybrid : rgb(243,26,136)
group: white
group: blue
group: black
group: red
group: green
group: colorless
group: artifact
group: multicolor
group: land
group: hybrid
statistics dimension: statistics dimension:
name: converted mana cost name: converted mana cost
...@@ -1006,6 +1016,7 @@ statistics dimension: ...@@ -1006,6 +1016,7 @@ statistics dimension:
statistics category: statistics category:
name: color / rarity name: color / rarity
type: stack
dimension: card color2 dimension: card color2
dimension: rarity dimension: rarity
...@@ -1174,7 +1185,7 @@ keyword parameter type: ...@@ -1174,7 +1185,7 @@ keyword parameter type:
match: [^(,\n]+ match: [^(,\n]+
keyword parameter type: keyword parameter type:
name: name name: name
match: [^(.,\n-—]+ match: [^(.,\n—-]+
keyword parameter type: keyword parameter type:
name: prefix name: prefix
description: Prefix for things like "<something>walk" description: Prefix for things like "<something>walk"
...@@ -1290,6 +1301,11 @@ keyword: ...@@ -1290,6 +1301,11 @@ keyword:
match: Fading <atom-param>number</atom-param> match: Fading <atom-param>number</atom-param>
mode: expert mode: expert
reminder: This comes into play with {english_number_a(param1)} fade counter(s) on it. At the beginning of your upkeep, remove a fade counter from it. If you can’t, sacrifice it. reminder: This comes into play with {english_number_a(param1)} fade counter(s) on it. At the beginning of your upkeep, remove a fade counter from it. If you can’t, sacrifice it.
keyword:
keyword: Kicker
match: Kicker <atom-param>mana</atom-param> and/or <atom-param>mana</atom-param>
mode: expert
reminder: You may pay an additional {param1} and/or {param2} as you play this spell.
keyword: keyword:
keyword: Kicker keyword: Kicker
match: Kicker <atom-param>cost</atom-param> match: Kicker <atom-param>cost</atom-param>
...@@ -1365,15 +1381,9 @@ keyword: ...@@ -1365,15 +1381,9 @@ keyword:
match: Sunburst match: Sunburst
mode: expert mode: expert
reminder: This comes into play with a {if has_pt() then "+1/+1" else "charge"} counter on it for each color of mana used to pay its cost. reminder: This comes into play with a {if has_pt() then "+1/+1" else "charge"} counter on it for each color of mana used to pay its cost.
#Two versions of splice needed because if there's no separator, the program doesn't know when to switch from param1 to param2.
keyword:
keyword: Splice (Mana Cost)
match: Splice onto <atom-param>name</atom-param> <atom-param>mana</atom-param>
mode: expert
reminder: As you play a {param1} spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card’s effects to that spell.
keyword: keyword:
keyword: Splice (Alternative Cost) keyword: Splice
match: Splice onto <atom-param>name</atom-param>—<atom-param>action</atom-param> match: Splice onto <atom-param>name</atom-param> <atom-param>cost</atom-param>
mode: expert mode: expert
reminder: As you play a {param1} spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card’s effects to that spell. reminder: As you play a {param1} spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card’s effects to that spell.
keyword: keyword:
......
...@@ -359,6 +359,7 @@ void KeywordDatabase::add(const Keyword& kw) { ...@@ -359,6 +359,7 @@ void KeywordDatabase::add(const Keyword& kw) {
// Add to trie // Add to trie
String text; // normal text String text; // normal text
size_t param = 0; size_t param = 0;
bool only_star = true;
for (size_t i = 0 ; i < kw.match.size() ;) { for (size_t i = 0 ; i < kw.match.size() ;) {
Char c = kw.match.GetChar(i); Char c = kw.match.GetChar(i);
if (is_substr(kw.match, i, _("<atom-param"))) { if (is_substr(kw.match, i, _("<atom-param"))) {
...@@ -384,9 +385,18 @@ void KeywordDatabase::add(const Keyword& kw) { ...@@ -384,9 +385,18 @@ void KeywordDatabase::add(const Keyword& kw) {
cur = cur->insert(text); cur = cur->insert(text);
text.clear(); text.clear();
cur = cur->insertAnyStar(); cur = cur->insertAnyStar();
// enough?
if (!only_star) {
// If we have matched anything specific, this is a good time to stop
// it doesn't really matter how long we go on, since the trie is only used
// as an optimization to not have to match lots of regexes.
// As an added bonus, we get a better behaviour of matching earlier keywords first.
break;
}
} else { } else {
text += c; text += c;
i++; i++;
only_star = false;
} }
} }
cur = cur->insert(text); cur = cur->insert(text);
......
...@@ -137,7 +137,11 @@ int KeywordList::OnGetItemImage(long pos) const { ...@@ -137,7 +137,11 @@ int KeywordList::OnGetItemImage(long pos) const {
wxListItemAttr* KeywordList::OnGetItemAttr(long pos) const { wxListItemAttr* KeywordList::OnGetItemAttr(long pos) const {
// black for set keywords, grey for game keywords (uneditable) // black for set keywords, grey for game keywords (uneditable)
const Keyword& kw = *getKeyword(pos); const Keyword& kw = *getKeyword(pos);
if (!kw.fixed) return nullptr; if (!kw.fixed && kw.valid) return nullptr;
item_attr.SetTextColour(lerp(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),0.5)); if (!kw.valid) {
item_attr.SetTextColour(*wxRED);
} else if (kw.fixed) {
item_attr.SetTextColour(lerp(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),0.5));
}
return &item_attr; return &item_attr;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment