Commit 89de0488 authored by twanvl's avatar twanvl

cleaned up magic keywords; correct drawing of placeholders

parent fe606b03
...@@ -308,7 +308,14 @@ tooltip: ...@@ -308,7 +308,14 @@ tooltip:
############################################################## Labels in the GUI ############################################################## Labels in the GUI
label: label:
# Cards tab
card notes: Card notes: card notes: Card notes:
# Keywords tab
keyword: Keyword
match: Matches
mode: Mode
uses: Uses
reminder: Reminder text
# Open dialogs # Open dialogs
all files All files all files All files
......
...@@ -214,6 +214,10 @@ init script: ...@@ -214,6 +214,10 @@ init script:
- 1 * number_of_items(in: sort(order:"/")) # guild mana, W/U -> 2 - 1 - 1 * number_of_items(in: sort(order:"/")) # guild mana, W/U -> 2 - 1
+ 1 * sort(order: "[0123456789]") # colorless mana + 1 * sort(order: "[0123456789]") # colorless mana
} }
colored_mana := {
number_of_items(in: sort(order: "WUBRG")) # colored mana
- number_of_items(in: sort(order:"/")) # guild mana, W/U -> 2 - 1
}
# TODO : somewhere else? # TODO : somewhere else?
#card to conversion: #card to conversion:
...@@ -277,10 +281,10 @@ set field: ...@@ -277,10 +281,10 @@ set field:
# TODO : RENAME # TODO : RENAME
type: multiple choice type: multiple choice
name: automatic reminder text2 name: automatic reminder text2
choice: old keywords choice: old
choice: core set keywords choice: core
choice: expert level keywords choice: expert
choice: custom keywords choice: custom
description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword. description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword.
set field: set field:
type: boolean type: boolean
...@@ -780,11 +784,35 @@ statistics dimension: ...@@ -780,11 +784,35 @@ statistics dimension:
numeric: true numeric: true
icon: stats/casting_cost.png icon: stats/casting_cost.png
statistics dimension:
name: colored mana cost
script: colored_mana(card.casting_cost)
numeric: true
icon: stats/colored_casting_cost.png
statistics dimension:
name: power2
script: card.power
numeric: true
icon: stats/power.png
statistics dimension:
name: toughness2
script: card.toughness
numeric: true
icon: stats/toughness.png
statistics category: statistics category:
name: color / rarity name: color / rarity
dimension: card_color dimension: card_color
dimension: rarity dimension: rarity
statistics category:
name: power / toughness
type: scatter
dimension: power2
dimension: toughness2
#statistics field: #statistics field:
# name: creature type # name: creature type
# data 1: # data 1:
...@@ -862,6 +890,8 @@ statistics category: ...@@ -862,6 +890,8 @@ statistics category:
has keywords: true has keywords: true
keyword preview: {keyword} <i>({reminder})</i>
keyword mode: keyword mode:
name: old name: old
description: Old keywords (Banding, Phasing, etc.) description: Old keywords (Banding, Phasing, etc.)
...@@ -885,7 +915,7 @@ keyword parameter type: ...@@ -885,7 +915,7 @@ keyword parameter type:
name: cost name: cost
#insert as: word #insert as: word
match: [XYZ0-9WUBRGS/]+|[^(.,\n]|([XYZ0-9WUBRGS/]+,)?[^(.,\n]* match: [XYZ0-9WUBRGS/]+|[^(.,\n]|([XYZ0-9WUBRGS/]+,)?[^(.,\n]*
script: "<sym-auto>{input}</sym-auto>" # TODO : DEBUG script: "<sym-auto>{mana_sort()}</sym-auto>" # TODO : DEBUG
keyword parameter type: keyword parameter type:
name: number name: number
match: [XYZ0-9]+ match: [XYZ0-9]+
...@@ -909,276 +939,303 @@ keyword parameter type: ...@@ -909,276 +939,303 @@ keyword parameter type:
name: name name: name
#insert as: word #insert as: word
match: [^(.,\n]+ match: [^(.,\n]+
keyword parameter type:
name: prefix
match: [A-Z][a-z]*
############################# All Magic keywords ############################# All Magic keywords
# By JrEye and Neko_Asakami # By JrEye and Neko_Asakami
keyword: keyword:
keyword: Flying keyword: Flying
mode: core
reminder: This creature can’t be blocked except by creatures with flying. reminder: This creature can’t be blocked except by creatures with flying.
keyword: keyword:
keyword: Haste keyword: Haste
mode: core
reminder: This creature can attack and tap the turn it comes under your control. reminder: This creature can attack and tap the turn it comes under your control.
keyword: keyword:
keyword: Fear keyword: Fear
mode: core
reminder: This creature can’t be blocked except by artifact creatures and/or black creatures. reminder: This creature can’t be blocked except by artifact creatures and/or black creatures.
keyword: keyword:
keyword: First strike keyword: First strike
mode: core
reminder: This creature deals combat damage before creatures without first strike. reminder: This creature deals combat damage before creatures without first strike.
keyword: keyword:
keyword: Enchant keyword: Enchant
separator: whitespace [ ] match: Enchant <param>name</param>
parameter: name mode: core
reminder: Target a <param> as you play this. This card comes into play attached to that <param>. reminder: Target a <param> as you play this. This card comes into play attached to that {param1}.
keyword: keyword:
keyword: Cycling keyword: Cycling
separator: whitespace [ ] match: Cycling <param>cost</param>
parameter: cost mode: core
reminder: {param1}, Discard this card: Draw a card. reminder: {param1}, Discard this card: Draw a card.
keyword: keyword:
keyword: Trample keyword: Trample
mode: core
reminder: If this creature would deal enough combat damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player. reminder: If this creature would deal enough combat damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player.
keyword: keyword:
keyword: Banding keyword: Banding
mode: old
reminder: When declaring attackers or blockers this creature may group with others creatures with banding and one creature without banding. When damage is dealt, you decide where damage is dealt. reminder: When declaring attackers or blockers this creature may group with others creatures with banding and one creature without banding. When damage is dealt, you decide where damage is dealt.
keyword: keyword:
keyword: Rampage keyword: Rampage
separator: whitespace [ ] match: Rampage <param>number</param>
parameter: number mode: old
reminder: Whenever this creature becomes blocked, it gets +<param>/+<param> until end of turn for each creature blocking it beyond the first. reminder: Whenever this creature becomes blocked, it gets +{param1}/+{param1} until end of turn for each creature blocking it beyond the first.
keyword: keyword:
keyword: Vigilance keyword: Vigilance
mode: core
reminder: Attacking doesn’t cause this creature to tap. reminder: Attacking doesn’t cause this creature to tap.
keyword: keyword:
keyword: Defender keyword: Defender
mode: core
reminder: This creature can’t attack. reminder: This creature can’t attack.
keyword: keyword:
keyword: Cumulative upkeep keyword: Cumulative upkeep
separator: whitespace [ ] match: Cumulative upkeep <param>cost</param>
parameter: cost mode: old
reminder: At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay <param> for each age counter on it. reminder: At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay {param1} for each age counter on it.
keyword: keyword:
keyword: Horsemanship keyword: Horsemanship
mode: old
reminder: This creature can’t be blocked except by creatures with horsemanship. reminder: This creature can’t be blocked except by creatures with horsemanship.
keyword: keyword:
keyword: Phasing keyword: Phasing
mode: old
reminder: At the beginning of your upkeep, put this and any cards attached to it in the phased-out zone. If this is already in the phased-out zone, return it and any card attached to it to play. If there were counters on this card when it phased out, put that many counters on it when it returns to play. This ability does not cause comes-into-play or leaves play abilities to trigger. reminder: At the beginning of your upkeep, put this and any cards attached to it in the phased-out zone. If this is already in the phased-out zone, return it and any card attached to it to play. If there were counters on this card when it phased out, put that many counters on it when it returns to play. This ability does not cause comes-into-play or leaves play abilities to trigger.
keyword: keyword:
keyword: Flanking keyword: Flanking
separator: whitespace [ ] match: Flanking <param>number</param>
parameter: number mode: old
reminder: Whenever a creature without flanking blocks this creature, the blocking creature gets -<param>/-<param> until end of turn. reminder: Whenever a creature without flanking blocks this creature, the blocking creature gets -{param1}/-{param1} until end of turn.
keyword: keyword:
keyword: Shadow keyword: Shadow
mode: core
reminder: This creature can block or be blocked by only creatures with shadow. reminder: This creature can block or be blocked by only creatures with shadow.
keyword: keyword:
keyword: Buyback keyword: Buyback
separator: whitespace [ ] match: Buyback <param>cost</param>
parameter: name mode: expert
reminder: You may pay <param> in addition to any other costs as you play this spell. If you do, put ~ into your hand instead of your graveyard as part of its resolution. reminder: You may pay {param1} in addition to any other costs as you play this spell. If you do, put ~ into your hand instead of your graveyard as part of its resolution.
keyword: keyword:
keyword: Echo keyword: Echo
mode: expert
reminder: At the beginning of your next upkeep after this permanent comes under your control, sacrifice it unless you pay its mana cost. reminder: At the beginning of your next upkeep after this permanent comes under your control, sacrifice it unless you pay its mana cost.
keyword: keyword:
keyword: Plainscycling keyword: Plainscycling
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: <param>, Discard this card: Search your library for a Plains card, reveal it, and put it into your hand. Then shuffle your library. reminder: <param>, Discard this card: Search your library for a Plains card, reveal it, and put it into your hand. Then shuffle your library.
keyword: keyword:
keyword: Islandcycling keyword: Landcycling
separator: whitespace [ ] match: <param>prefix</param>cycling <param>cost</param>
parameter: cost mode: expert
reminder: <param>, Discard this card: Search your library for a Island card, reveal it, and put it into your hand. Then shuffle your library. reminder: {param2}, Discard this card: Search your library for a {param1} card, reveal it, and put it into your hand. Then shuffle your library.
keyword:
keyword: Swampcycling
separator: whitespace [ ]
parameter: cost
reminder: <param>, Discard this card: Search your library for a Swamp card, reveal it, and put it into your hand. Then shuffle your library.
keyword:
keyword: Mountaincycling
separator: whitespace [ ]
parameter: cost
reminder: <param>, Discard this card: Search your library for a Mountain card, reveal it, and put it into your hand. Then shuffle your library.
keyword:
keyword: Forestcycling
separator: whitespace [ ]
parameter: cost
reminder: <param>, Discard this card: Search your library for a Forest card, reveal it, and put it into your hand. Then shuffle your library.
keyword: keyword:
keyword: Fading keyword: Fading
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (a, two, ...) parameter: number (a, two, ...)
mode: expert
reminder: This comes into play with <param> 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 <param> 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:
keyword: Kicker keyword: Kicker
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: You may pay an additional <param> as you play this spell. reminder: You may pay an additional <param> as you play this spell.
keyword: keyword:
keyword: Madness keyword: Madness
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: You may play this card for its madness cost at the time you discard it. reminder: You may play this card for its madness cost at the time you discard it.
keyword: keyword:
keyword: Threshold keyword: Threshold
separator: dash [ - ] separator: dash [ - ]
parameter: action parameter: action
mode: expert
reminder: You have threshold as long as seven or more cards are in your graveyard. reminder: You have threshold as long as seven or more cards are in your graveyard.
keyword: keyword:
keyword: Flashback keyword: Flashback
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: You may play this card from your graveyard for its flashback cost. Then remove it from the game. reminder: You may play this card from your graveyard for its flashback cost. Then remove it from the game.
keyword: keyword:
keyword: Morph keyword: Morph
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: You may play this face down as a 2/2 creature for [3]. Turn it face up any time for its morph cost. reminder: You may play this face down as a 2/2 creature for [3]. Turn it face up any time for its morph cost.
keyword: keyword:
keyword: Amplify keyword: Amplify
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (a, two, ...) parameter: number (a, two, ...)
mode: expert
reminder: As this card comes into play, put <param> +1/+1 counter(s) on it for each creature that shares a type with this that you reveal in your hand. reminder: As this card comes into play, put <param> +1/+1 counter(s) on it for each creature that shares a type with this that you reveal in your hand.
keyword: keyword:
keyword: Double strike keyword: Double strike
mode: expert
reminder: This creature deals both first-strike and regular combat damage. reminder: This creature deals both first-strike and regular combat damage.
keyword: keyword:
keyword: Provoke keyword: Provoke
mode: expert
reminder: When this attacks, you may have target creature defending player controls untap and block it if able. reminder: When this attacks, you may have target creature defending player controls untap and block it if able.
keyword: keyword:
keyword: Storm keyword: Storm
mode: expert
reminder: When you play this spell, copy it for each spell played before it this turn. You may choose new targets for the copies. reminder: When you play this spell, copy it for each spell played before it this turn. You may choose new targets for the copies.
keyword: keyword:
keyword: Affinity for keyword: Affinity for
separator: whitespace [ ] separator: whitespace [ ]
parameter: name parameter: name
reminder: This spell costs <sym>1</sym> less to play for each <param> you control. mode: expert
reminder: This spell costs <sym>1</sym> less to play for each {param1} you control.
keyword: keyword:
keyword: Entwine keyword: Entwine
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: Choose both if you pay the entwine cost. reminder: Choose both if you pay the entwine cost.
keyword: keyword:
keyword: Equip keyword: Equip
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: <param>: Attach to target creature you control. Equip only as a sorcery. This card comes into play unattached and stays in play if the creature leaves play. reminder: <param>: Attach to target creature you control. Equip only as a sorcery. This card comes into play unattached and stays in play if the creature leaves play.
keyword: keyword:
keyword: Imprint keyword: Imprint
separator: dash [ - ] separator: dash [ - ]
parameter: action parameter: action
mode: expert
reminder: The removed card is imprinted on this artifact. reminder: The removed card is imprinted on this artifact.
keyword: keyword:
keyword: Modular keyword: Modular
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (a, two, ...) parameter: number (a, two, ...)
mode: expert
reminder: This comes into play with <param> +1/+1 counter(s) on it. When it’s put into a graveyard, you may put its +1/+1 counters on target artifact creature. reminder: This comes into play with <param> +1/+1 counter(s) on it. When it’s put into a graveyard, you may put its +1/+1 counters on target artifact creature.
keyword: keyword:
keyword: Scry keyword: Scry
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (, two, ...) parameter: number (, two, ...)
mode: expert
reminder: Look at the top <param> card(s) of your library. Put any number of them on the bottom of your library in any order and the rest on top of your library in any order. reminder: Look at the top <param> card(s) of your library. Put any number of them on the bottom of your library in any order and the rest on top of your library in any order.
keyword: keyword:
keyword: Sunburst keyword: Sunburst
mode: expert
reminder: This comes into play with a +1/+1 counter on it for each color of mana used to pay its cost. If it is not a creature, use charge counters instead. reminder: This comes into play with a +1/+1 counter on it for each color of mana used to pay its cost. If it is not a creature, use charge counters instead.
#keyword: #keyword:
# keyword: Splice onto keyword: Splice
# separator: whitespace [ ] match: Splice onto <param>name</param> <param>cost</param>
# parameter: name mode: expert
# reminder: As you play a <param> 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:
keyword: Splice onto Arcane keyword: Splice onto Arcane
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: As you play an Arcane 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 an Arcane 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: Offering keyword: Offering
separator: dash [ - ] separator: dash [ - ]
parameter: name parameter: name
mode: expert
reminder: You may play this card any time you could play an instant by sacrificing a <param> and paying the difference in mana costs between this and the sacrificed <param>. Mana cost includes color. reminder: You may play this card any time you could play an instant by sacrificing a <param> and paying the difference in mana costs between this and the sacrificed <param>. Mana cost includes color.
keyword: keyword:
keyword: Bushido keyword: Bushido
separator: whitespace [ ] separator: whitespace [ ]
parameter: number parameter: number
mode: expert
reminder: When this blocks or becomes blocked, it gets +<param>/+<param> until end of turn. reminder: When this blocks or becomes blocked, it gets +<param>/+<param> until end of turn.
keyword: keyword:
keyword: Ninjutsu keyword: Ninjutsu
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: <param>, Return an unblocked attacker you control to hand: Put this card into play from your hand tapped and attacking. reminder: <param>, Return an unblocked attacker you control to hand: Put this card into play from your hand tapped and attacking.
keyword: keyword:
keyword: Soulshift keyword: Soulshift
separator: whitespace [ ] separator: whitespace [ ]
parameter: number parameter: number
mode: expert
reminder: When this is put into a graveyard from play, you may return target Spirit card with converted mana cost <param> or less from you graveyard to your hand. reminder: When this is put into a graveyard from play, you may return target Spirit card with converted mana cost <param> or less from you graveyard to your hand.
keyword: keyword:
keyword: Epic keyword: Epic
mode: expert
reminder: For the rest of the game, you can’t play spells. At the beginning of each of your upkeeps, copy this spell except for its epic ability. If the spell has any targets, you may choose new targets for the copy. reminder: For the rest of the game, you can’t play spells. At the beginning of each of your upkeeps, copy this spell except for its epic ability. If the spell has any targets, you may choose new targets for the copy.
keyword: keyword:
keyword: Convoke keyword: Convoke
mode: expert
reminder: Each creature you tap while playing this spell reduces its cost by <sym>1</sym> or by one mana of that creature’s color. reminder: Each creature you tap while playing this spell reduces its cost by <sym>1</sym> or by one mana of that creature’s color.
keyword: keyword:
keyword: Transmute keyword: Transmute
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: <param>, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Play only as a sorcery. reminder: <param>, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Play only as a sorcery.
keyword: keyword:
keyword: Haunt keyword: Haunt
mode: expert
reminder: When this card is put into a graveyard from play, remove it from the game haunting target creature. reminder: When this card is put into a graveyard from play, remove it from the game haunting target creature.
keyword: keyword:
keyword: Bloodthirst keyword: Bloodthirst
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (a, two, ...) parameter: number (a, two, ...)
mode: expert
reminder: If an opponent was dealt damage this turn, this creature comes into play with <param> +1/+1 counter(s) on it. reminder: If an opponent was dealt damage this turn, this creature comes into play with <param> +1/+1 counter(s) on it.
keyword: keyword:
keyword: Replicate keyword: Replicate
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: When you play this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies. reminder: When you play this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.
keyword:
keyword: Islandwalk
reminder: This creature is unblockable as long as defending player controls a Island.
keyword:
keyword: Forestwalk
reminder: This creature is unblockable as long as defending player controls a Forest.
keyword:
keyword: Mountainwalk
reminder: This creature is unblockable as long as defending player controls a Mountain.
keyword:
keyword: Plainswalk
reminder: This creature is unblockable as long as defending player controls a Plains.
keyword:
keyword: Swampwalk
reminder: This creature is unblockable as long as defending player controls a Swamp.
keyword: keyword:
keyword: Legendary Landwalk keyword: Legendary Landwalk
mode: core
reminder: This creature is unblockable as long as defending player controls a Legendary land. reminder: This creature is unblockable as long as defending player controls a Legendary land.
keyword: keyword:
keyword: Non-basic Landwalk keyword: Non-basic Landwalk
mode: core
reminder: This creature is unblockable as long as defending player controls a non-basic land. reminder: This creature is unblockable as long as defending player controls a non-basic land.
keyword: keyword:
keyword: Snow-covered Landwalk keyword: Snow-covered Landwalk
mode: core
reminder: This creature is unblockable as long as defending player controls a Snow-covered land. reminder: This creature is unblockable as long as defending player controls a Snow-covered land.
keyword: keyword:
keyword: Denimwalk keyword: Denimwalk
mode: core
reminder: If defending player is wearing any clothing made of denim, this creature is unblockable. reminder: If defending player is wearing any clothing made of denim, this creature is unblockable.
keyword:
keyword: Landwalk
match: <param>prefix</param>walk
mode: core
reminder: This creature is unblockable as long as defending player controls a {param1}.
keyword: keyword:
keyword: Protection from keyword: Protection from
separator: whitespace [ ] separator: whitespace [ ]
parameter: name parameter: name
mode: core
reminder: This creature can’t be blocked, targeted, dealt damage, or enchanted by anything <param>. reminder: This creature can’t be blocked, targeted, dealt damage, or enchanted by anything <param>.
keyword: keyword:
keyword: Dredge keyword: Dredge
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (one, two, ...) parameter: number (one, two, ...)
mode: expert
reminder: As long as you have at least <param> card(s) in your library, if you would draw a card, you may instead put exactly <param> card(s) from the top of your library into your graveyard and return this card from your graveyard to your hand. reminder: As long as you have at least <param> card(s) in your library, if you would draw a card, you may instead put exactly <param> card(s) from the top of your library into your graveyard and return this card from your graveyard to your hand.
keyword: keyword:
keyword: Graft keyword: Graft
separator: whitespace [ ] separator: whitespace [ ]
parameter: number (a, two, ...) parameter: number (a, two, ...)
mode: expert
reminder: This creature comes into play with <param> +1/+1 counter(s) on it. Whenever another creature comes into play, you may move a +1/+1 counter from this creature onto it. reminder: This creature comes into play with <param> +1/+1 counter(s) on it. Whenever another creature comes into play, you may move a +1/+1 counter from this creature onto it.
keyword: keyword:
keyword: Forecast keyword: Forecast
separator: whitespace [ ] separator: whitespace [ ]
parameter: cost parameter: cost
mode: expert
reminder: Play this ability only during your upkeep and only once each turn. reminder: Play this ability only during your upkeep and only once each turn.
...@@ -27,7 +27,7 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const { ...@@ -27,7 +27,7 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const {
shadow_color.initDependencies(ctx, dep); shadow_color.initDependencies(ctx, dep);
} }
FontP Font::make(bool bold, bool italic) const { FontP Font::make(bool bold, bool italic, bool placeholder_color) const {
FontP f(new Font(*this)); FontP f(new Font(*this));
if (bold) f->font.SetWeight(wxBOLD); if (bold) f->font.SetWeight(wxBOLD);
if (italic) { if (italic) {
...@@ -37,6 +37,10 @@ FontP Font::make(bool bold, bool italic) const { ...@@ -37,6 +37,10 @@ FontP Font::make(bool bold, bool italic) const {
f->font.SetWeight(wxBOLD); f->font.SetWeight(wxBOLD);
} }
} }
if (placeholder_color) {
f->color = f->separator_color;
f->shadow_displacement = RealSize(0,0); // no shadow
}
return f; return f;
} }
......
...@@ -40,8 +40,8 @@ class Font { ...@@ -40,8 +40,8 @@ class Font {
/// Does this font have a shadow? /// Does this font have a shadow?
inline bool hasShadow() { return shadow_displacement.width != 0 || shadow_displacement.height != 0; } inline bool hasShadow() { return shadow_displacement.width != 0 || shadow_displacement.height != 0; }
/// Make a bold/italic version of this font /// Make a bold/italic/placeholder version of this font
FontP make(bool bold, bool italic) const; FontP make(bool bold, bool italic, bool placeholder_color) const;
private: private:
DECLARE_REFLECTION(); DECLARE_REFLECTION();
......
...@@ -360,14 +360,15 @@ String KeywordDatabase::expand(const String& text, ...@@ -360,14 +360,15 @@ String KeywordDatabase::expand(const String& text,
// j = even -> parameter #(j/2) // j = even -> parameter #(j/2)
size_t start_u, len_u; size_t start_u, len_u;
kw->matchRe.GetMatch(&start_u, &len_u, j); kw->matchRe.GetMatch(&start_u, &len_u, j);
size_t part_end = untagged_to_index(s, start_u + len_u, true); // note: start_u can be (uint)-1 when len_u == 0
size_t part_end = len_u > 0 ? untagged_to_index(s, start_u + len_u, true) : start;
String part = s.substr(start, part_end - start); String part = s.substr(start, part_end - start);
if ((j % 2) == 0) { if ((j % 2) == 0) {
// parameter // parameter
String param = untagged.substr(start_u, len_u); // untagged version String param = untagged.substr(start_u, len_u); // untagged version
if (param.empty()) { if (param.empty()) {
// placeholder // placeholder
param = _("<atom-kwpph>") + kw->parameters[j/2-1]->name + _("</atom-kwpph>"); param = _("<atom-kwpph>") + kw->parameters[j/2-1]->name + _("</atom-kwpph>");
part = part + param; // keep tags part = part + param; // keep tags
} else if (kw->parameters[j/2-1]->script) { } else if (kw->parameters[j/2-1]->script) {
// apply parameter script // apply parameter script
......
...@@ -27,7 +27,7 @@ KeywordList::KeywordList(Window* parent, int id, long additional_style) ...@@ -27,7 +27,7 @@ KeywordList::KeywordList(Window* parent, int id, long additional_style)
// Add columns // Add columns
InsertColumn(0, _LABEL_("keyword"), wxLIST_FORMAT_LEFT, 0); InsertColumn(0, _LABEL_("keyword"), wxLIST_FORMAT_LEFT, 0);
InsertColumn(1, _LABEL_("match"), wxLIST_FORMAT_LEFT, 200); InsertColumn(1, _LABEL_("match"), wxLIST_FORMAT_LEFT, 200);
InsertColumn(2, _LABEL_("mode"), wxLIST_FORMAT_LEFT, 100); InsertColumn(2, _LABEL_("mode"), wxLIST_FORMAT_LEFT, 60);
InsertColumn(3, _LABEL_("uses"), wxLIST_FORMAT_RIGHT, 80); InsertColumn(3, _LABEL_("uses"), wxLIST_FORMAT_RIGHT, 80);
InsertColumn(4, _LABEL_("reminder"), wxLIST_FORMAT_LEFT, 300); InsertColumn(4, _LABEL_("reminder"), wxLIST_FORMAT_LEFT, 300);
} }
......
...@@ -108,7 +108,7 @@ struct TextElementsFromString { ...@@ -108,7 +108,7 @@ struct TextElementsFromString {
te.elements.push_back(new_shared5<SymbolTextElement>(text, pos, pos + 1, style.symbol_font, &ctx)); te.elements.push_back(new_shared5<SymbolTextElement>(text, pos, pos + 1, style.symbol_font, &ctx));
} else { } else {
te.elements.push_back(new_shared6<FontTextElement> (text, pos, pos + 1, te.elements.push_back(new_shared6<FontTextElement> (text, pos, pos + 1,
style.font.make(bold > 0, italic > 0), style.font.make(bold > 0, italic > 0, soft > 0 || kwpph > 0),
soft > 0 ? DRAW_ACTIVE : DRAW_NORMAL, soft > 0 ? DRAW_ACTIVE : DRAW_NORMAL,
line > 0 ? BREAK_LINE : BREAK_HARD)); line > 0 ? BREAK_LINE : BREAK_HARD));
} }
......
...@@ -15,12 +15,6 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co ...@@ -15,12 +15,6 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co
if ((what & draw_as) != draw_as) return; // don't draw if ((what & draw_as) != draw_as) return; // don't draw
dc.SetFont(font->font, font->size * scale); dc.SetFont(font->font, font->size * scale);
if (end != start && text.substr(end-1, 1) == _("\n")) end -= 1; // don't draw the newline character at the end if (end != start && text.substr(end-1, 1) == _("\n")) end -= 1; // don't draw the newline character at the end
if (draw_as == DRAW_ACTIVE) {
// we are drawing a separator
dc.SetTextForeground(font->separator_color);
dc.DrawText(text.substr(start, end-start), rect.position());
} else {
// draw normally
// draw shadow // draw shadow
if (font->hasShadow()) { if (font->hasShadow()) {
dc.SetTextForeground(font->shadow_color); dc.SetTextForeground(font->shadow_color);
...@@ -29,7 +23,6 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co ...@@ -29,7 +23,6 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co
// draw // draw
dc.SetTextForeground(font->color); dc.SetTextForeground(font->color);
dc.DrawText(text.substr(start, end - start), rect.position()); dc.DrawText(text.substr(start, end - start), rect.position());
}
} }
void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const { void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <script/functions/functions.hpp> #include <script/functions/functions.hpp>
#include <script/functions/util.hpp> #include <script/functions/util.hpp>
#include <util/tagged_string.hpp> #include <util/tagged_string.hpp>
#include <util/error.hpp>
// ----------------------------------------------------------------------------- : Numbers // ----------------------------------------------------------------------------- : Numbers
...@@ -71,6 +72,14 @@ SCRIPT_FUNCTION(english_number_a) { ...@@ -71,6 +72,14 @@ SCRIPT_FUNCTION(english_number_a) {
// ----------------------------------------------------------------------------- : Singular/plural // ----------------------------------------------------------------------------- : Singular/plural
SCRIPT_FUNCTION(english_singular) {
throw InternalError(_("TODO"));
}
SCRIPT_FUNCTION(english_plural) {
throw InternalError(_("TODO"));
}
// ----------------------------------------------------------------------------- : Hints // ----------------------------------------------------------------------------- : Hints
// insert a hint, <hint-1> for singular, <hint-2> otherwise // insert a hint, <hint-1> for singular, <hint-2> otherwise
......
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