Commit Graph

246 Commits

Author SHA1 Message Date
twanvl c8dd777bca EnumReader now warns about the correct string,
parse_enum function throws if the string can not be parsed

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1341 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-11 00:45:21 +00:00
twanvl 1b90f0666c fixed bug: empty OptionalScript were saved as empty string, causing parse error when reading.
custom pack types can now be removed again.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1329 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-10 01:47:50 +00:00
twanvl 689f5dfd3a fixed tag eating and text duplication in spellchecker
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1314 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-09 02:43:35 +00:00
twanvl 05ba96ab3e slightly less tagged string checking
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1304 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-08 17:25:36 +00:00
twanvl eed4c5301e - Added some calls to assert_tagged
- The tag_contents script function now works as advertised:
     - uses 'input' script variable instead of 'contents'
     - keeps the full old tag, not the one from 'tag'
     - no template code in svn breaks.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1303 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-08 17:14:20 +00:00
twanvl 1541d57c1a use font settings for drawing multiple choice text labels, spacing and direction are scriptable.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1298 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-08 14:19:17 +00:00
coppro ed16dd6864 Updated dictionary
Added new <nospellcheck> tag, to prevent spell-checking of words within.
Prevented spellchecking of anything a) matching a keyword or b) formed from a cardname atom
Replaced ` as LEGENDNAME alternative; I think it's a bug that it's gone


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1288 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-03 06:16:02 +00:00
coppro 46dda0ef30 Compatibility updates; Boost Regex is now statically linked, changed to <hunspell/hunspell.hxx>
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1286 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-02 21:52:08 +00:00
twanvl 311a743fa1 simplified handling of punctuation is spellchecker, now checks for stand alone punctuation and double spaces.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1275 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-31 03:11:25 +00:00
twanvl e36dc6e6cb apply spelling corrections from the context menu.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1274 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-30 19:51:41 +00:00
twanvl 12f8be203e The check_spelling function now has support for additional dictionaries and regexes to match.
The magic game uses these features.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1269 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-30 02:09:11 +00:00
twanvl 09216eca5d punctuation breaking is now handled by check_spelling function. Symbols are now handled correctly (i.e. they are considered to be always correct)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1268 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-29 22:24:16 +00:00
twanvl 2f3eb3ce78 warn about incorrect string escape sequences
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1266 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-29 19:12:28 +00:00
twanvl dcbc03ee44 toCode should now never give an error, instead returning things like "<card>"
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1265 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-29 18:50:08 +00:00
twanvl 6b39fa844b fixed bug in filter_text: it was doing something completely incorrect
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1263 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-29 18:43:05 +00:00
twanvl a57170e7c2 Simple spelling checker using the Hunspell library.
This time adding the source files :)

The checker is used (experimentally) by the magic game file.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1262 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-29 01:34:13 +00:00
twanvl 1ac3294993 Simple spelling checker using the Hunspell library.
Currently the checker is only exposed through the script function check_spelling_word, which returns true if the word is spelled correctly.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1261 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-28 21:44:48 +00:00
twanvl 0cd128cfb3 more detailed profiling of getMember
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1247 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-11 17:35:21 +00:00
twanvl dc2028a956 let profiler trace 'get member' calls, because I suspect they might be slow (linear string lookup)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1244 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-11 16:28:17 +00:00
twanvl 010c8d8d0b minor script parser things
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1243 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-11 15:46:51 +00:00
twanvl d4e9476759 fixed: "include file" did not reset the parent package, so this didn't work:
script:
    include file: /other-package/stuff
    include file: something-from-this-package


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1242 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-11 15:24:48 +00:00
coppro 692d5b6286 Updates to make things work.
Some trivial things that are required to make it work on Linux.
Also updated build scripts to use Boost. You have to use
./configure --with-boost-regex=<libname, suitable for -l>


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1206 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-09-07 17:21:25 +00:00
twanvl f405b82ce2 Split script profiler into a separate file
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1201 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-09-03 20:55:48 +00:00
twanvl 7c83ff01f4 Made a Regex class that wraps either boost::regex or wxRegEx (split from ScriptRegex).
Use Regex for keywords.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1196 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-09-03 14:43:11 +00:00
twanvl f1f4c30e44 Simplify regex code by moving things to the Results class, and by using iterators instead of positions
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1193 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-09-02 18:56:39 +00:00
twanvl aab910dc38 (optionally) use boost::regex instead of wxRegex, because it is faster
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1192 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-09-02 16:29:05 +00:00
twanvl 9709364ee7 Script profiler for finding slow scripts
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1191 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-09-02 16:27:47 +00:00
twanvl a2af3211a4 Moved mask to Style and mask related drawing to ValueViewer.
Used the same mask also for TextStyles.
To keep the text selectable (since the mask is now also used for containsPoint), the future sight cost masks needed to be updated.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1183 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-30 23:49:12 +00:00
twanvl a183ecc9a6 New class CachedScriptableMask: like CachedScriptableImage, only containing an AlphaMask instead of an Image/Bitmap.
Use CachedScriptableMask for all masks.

TODO: This introduces some duplicate code in ValueViewers that could be fixed by moving mask to the Style base class.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1182 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-30 21:51:38 +00:00
twanvl acb3493b59 Merged behaviour from ContourMask into AlphaMask.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1181 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-30 17:15:22 +00:00
twanvl 6e19511d48 minor fixes for building with vs2008.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1179 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-30 13:14:30 +00:00
twanvl dc9405e441 Added some more classes for ScriptErrors;
Added split_text function, which is the 'opposite' of break_text;
Script code "f\n(stuff)" now parses as "f;stuff" instead of a function call, "f(stuff)";
Fixed bug in cursor movement, which caused the closing > of a tag at end of input to be overwritten.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1175 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-27 18:44:59 +00:00
twanvl 9abfdd171c added "for each k:v in .. do .." statement
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1174 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-27 13:06:24 +00:00
twanvl 42d40dbd1e Added Package::saveCopy, which is used to implement the write_set_file script function.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1169 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-24 19:48:51 +00:00
twanvl b28ae56b25 close scopes in exception handler
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1166 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-24 18:26:31 +00:00
twanvl c8fb341e1a Fixed random_int and random_real functions; added random_boolean.
Split random_select into random_select and random_select_many.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1161 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-24 16:08:13 +00:00
coppro ec63e3b18b More workingness, now accepts locally-stored resources!
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1158 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-21 04:06:50 +00:00
twanvl f1fe40b4ef Added new_card function;
Added parameter to ScriptValue::next to recieve the key of the item.
Finished Add Multiple Cards behaviour.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1147 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-11 20:52:33 +00:00
twanvl 9e77a63526 Allow writing files anywhere from the command lines interface, not just in the working directory
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1116 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-09 01:54:17 +00:00
twanvl d14af1c43a Fixed possible crash in dependency checking
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1113 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-08 23:53:59 +00:00
twanvl 44f6acade7 Dependencies on stylesheet are marked, and updated when the stylesheet changes
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1087 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-07 20:50:19 +00:00
twanvl ee9060077b Fixed conversion bug in position_of function;
to_real no longer needs to throw exceptions when conversion fails

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1086 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-07 19:39:06 +00:00
twanvl b5bdaedde2 Fixed conversion from Values to other types: Values now report being of the contained type.
Added toImage function to ScriptValue.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1083 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-07 16:26:33 +00:00
twanvl c6fe6634dd Tweaked the way to use getScript() like functions;
Made condition and default_expand parameters of expand_keywords optional.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1080 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-07 01:54:13 +00:00
twanvl 2c6c6645f7 Lower case keywords are now recognized, but only if all parameters are given.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1078 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-07 01:01:51 +00:00
twanvl 1d38312d05 Moved part of keyword matching into a separate function; it was way too long
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1077 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-07 00:24:02 +00:00
twanvl dd006b9eca Fixed bug in dependency checker that caused it to overwrite variables outside its scope
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1063 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-05 17:02:32 +00:00
twanvl 5e4ce2862d fixed parsing of "x.0.y", the second dot was seen as a decimal point.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1058 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-05 00:31:45 +00:00
twanvl 6a71b20d26 Files can be written from command line interface
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1054 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-04 21:01:40 +00:00
twanvl 95b5fa67a2 - Added SetWindow::setControlStatusText function for setting the status text of child controls, since wx lacks a feature for doing it automatically.
- RandomPackPanel's spin controls are cleaned up when the set is reloaded
- to_int script function now converts empty string: to_int("") == 0

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1042 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-03 20:01:59 +00:00