Gulix / geckos

An online Card Editor with Templates
http://gulix.github.io/geckos/
Other
48 stars 18 forks source link

Multiple instances of card[field] in a code variable breaks the evaluation #61

Closed Gulix closed 8 years ago

Gulix commented 8 years ago

Related to Issue #10

{ "type": "textbox", "width": 82, "left": 87, "textAlign": "center", "top": 460, "fontWeight": "bold", "fontSize": 20, "text": "{{if (card[health] == 'd8') { value = 'd6'; } else if (card[health] == 'd10') { value = 'd8'; } else if (card[health] == 'd12') { value = 'd10'; }}}", "visible": "{{value = (card[health] != 'd6') && (card[health] != 'd6');}}" }

This breaks because the replacement of card[health] by self.getValue('health') is not working correctly.