Commit Graph

104 Commits

Author SHA1 Message Date
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 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 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
twanvl 76d2eb7d42 Remove curly quotes for MWS and apprentice export
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1038 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-02 20:43:45 +00:00
twanvl 2f5666ac5b dependencies of extra card fields are now also added and updated;
this fixes combined_editor in extra fields.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1036 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-02 19:16:30 +00:00
twanvl 13a37f4734 Simplified compilation of 'assert' pseudo function;
Added remove_duplicates flag to sort_list function;
Fixed documentation of <size:> tag

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1028 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-07-22 22:46:04 +00:00
twanvl 53808346a4 Allow "or else" construct to be used for error recovery
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1016 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-07-09 17:14:49 +00:00
twanvl 7cb2292d36 Added ^ power operator,
Added abs, random_int, random_real, random_shuffle, random_select script functions.
Made == comparison of doubles use a small epsilon, so things like 3/2 == 1.5 are actually true.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1013 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-07-09 15:51:07 +00:00
twanvl fe2e3fb9c8 Be more strict about type conversion:
* numbers are no longer auto converted to booleans, use to_boolean or != 0
  * booleans are no longer auto converted to numbers, use to_int
  * strings will soon no longer be auto converted to numbers, use to_int

Added version information ("since 0.3.7") to documentation

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1006 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-28 13:34:57 +00:00
twanvl a9c5f72fdc Make == script operator to work correctly on collections (lists)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@992 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-18 23:11:26 +00:00
twanvl b7ffca6cfc Split regex related script functions into a separate file.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@991 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-18 22:25:45 +00:00
twanvl 864903bc0c Use closure stuff for making built in *_rule functions, simplifying the code.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@990 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-18 22:17:56 +00:00
twanvl 296cf8197a Also init dependencies of non rule form expand_keywords
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@989 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-18 21:45:12 +00:00
twanvl 95d38f9ba6 Added 'assert' pseudo function so I can run some tests of the script code
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@988 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-18 21:01:17 +00:00
twanvl 2662f9d4bf Optimize default arguments (@ operator) into script rules.
The plan is to deprecate rule form completely, so instead of replace_rule(match:..) write replace_text@(match: ...)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@987 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-18 19:25:18 +00:00
twanvl aa950d1821 Use smart_less when sorting collections
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@967 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-03 19:26:23 +00:00
twanvl c5159ebcf7 "div" operator for integer division,
Added parser support for closure operator fun@(args)
Use equal() function for all script comparisons, better support for deciding when to use strings and when to use pointers equality.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@964 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-03 16:38:33 +00:00
twanvl 97ccf34dce Slightly more information on script errors in keyword reminder text
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@930 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-01 00:50:51 +00:00
twanvl 1a7e689e95 Added break_text function
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@857 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-05-18 17:27:44 +00:00
coppro 26562e03e3 Updated copyright information - added my name and also changed 2007 to 2008
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@837 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-04-06 18:16:32 +00:00
coppro 60b1bb0489 Fixed that stupid user-made keyword precedence bug.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@828 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-02-10 02:14:15 +00:00
twanvl d2196eea09 Finally got precompiled headers to work.
Now all C++ files need to #include <util/prec.hpp>
 That is why all .cpp files are touched by this commit

Many changes to installers and update checking:
     - the window is now called PackagesWindow, in a new source file
     - update checking is now independent from the PackagesWindow. For update checking only a list of package versions are needed (vector<PackageDependency>). This is much less information to download at each startup.
     - the list of available packages is now a list of available Installers, since an installer can contain multiple packages.
     - moved the logic of dependency checking etc. to data/installer
     - moved the actual installation to util/io/package_manager
     - moved directory iteration/creation logic to util/file_utils
     - added PackageDirectory: the local and global package directory now have their own object (was part of PackageManager)
     - added PackageVersion: for detecting if a package has been modified after it was installed.
     - added PackageDescription: description/header of a package. Basicly the same as what Packaged provides.
     - added DownloadableInstaller: where to find an insaller, what does it contain?
     - added InstallablePackage: brining it all together: installer, package, status, action.

Current status: the insaller is currently broken in a few places, more on that soon.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@792 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-29 18:30:41 +00:00
twanvl 4405863485 Added caching to filter_text script function
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@786 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-26 17:43:17 +00:00
twanvl 547a48b98d - Optimization: common parameters to built in functions are no longer looked up as a string at each call, instead their integer ids are global constants
- Optimization: some other minor tweaks.
 - Nicer --help message

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@783 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-24 02:04:45 +00:00
coppro dd656ba1bd Fixed "regex escape" function, and updated a script that needed it.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@762 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-30 14:37:18 +00:00
twanvl fcc89b64d6 Added support for scripts to determine word lists;
Added 'trim' and 'remove_tags' script functions;
Simplified safety improvements of locale checker;
Added 'is_targeted' function to magic game to replace the contains(..) calls

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@635 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-28 18:33:38 +00:00
twanvl 61136d79a8 Added regex_escape script function (was already used by keyword code);
Added icons for 'sort special rarity' choice.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@625 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-24 20:24:10 +00:00
twanvl d68f73edfc Various tweaks and fixes, mostly to the drop down lists
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@620 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-23 23:29:20 +00:00
twanvl a112f885ca Moved spec_sort to separate file, added more advanced options;
Split 'sort' script function into 'sort_text' and 'sort_list';
Double clicking card in stats panel switches to cards panel

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@587 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-01 18:34:24 +00:00
twanvl 8833d07c4a Added 'filter' support to position function; Made sure sort script can depend on the value of the field itself.
Cleaned up some things, why is a blank image not thread safe?

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@548 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-10 18:57:41 +00:00
twanvl 43d92a5ce7 Keyword usage can now be used for statistics
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@517 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-07 01:39:08 +00:00
twanvl 86235dfc91 Fixed undo issue for combined editor;
Added keyword usage statistics

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@516 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-07 00:55:27 +00:00
twanvl c52dfe4f1d Fixed font size of code in keywords tab;
Added 'recursive' flag to replace_rule function

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@487 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-05 14:44:24 +00:00
twanvl b91dd379cf Fixed curly quotes after parenthesis: ("
Font size is now independent of screen DPI, at least on windows

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@478 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-04 14:50:44 +00:00
coppro 14b68de6cb Added "AE" filter to flavor text. Allowed nesting of curly quotes.
Also compatibility update.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@445 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-29 18:36:45 +00:00
twanvl 5c6cb41458 implemented html export (only for writing the main file, not the write_file functions);
fixed parser bug: (...\n...) was not parsed as a statement separator if the second ... starts with a string or number


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@432 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-25 16:31:09 +00:00
twanvl e46cbe66b2 Cleaned up Set::Styling/Card::Styling by spliting that functionality into a 'DelayedIndexMaps' class;
Added 'right' and 'bottom' properties to style as an alternative way of specifying width/height;
Added content_width, content_height and content_lines properties that give feedback on text rendering;
Always show warnings when showing errors and vice-versa, this prevents script errors from appearing before the reader/parse error that caused them;
Finally some preliminairy work on export templates

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@428 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-22 23:12:41 +00:00
twanvl 97e0e8d6d6 Choice rendering now uses "style.image()" instead of "style.choice_images[value]";
Added script functions for working with multiple choice values;
Added in_context support for filter_rule;
Optimized toUpper/toLower because they are slow on windows (they use thread local storage and mutexes)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@427 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-17 13:13:56 +00:00
twanvl 6e55175f51 Fixed: < was matched by spec_sort "<xyz>"
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@421 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-14 14:24:49 +00:00
coppro 06138ee325 Made spec_sort specifications featuring more than one '()' not hang.
Added error window if a script error occurs while loading a set.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@412 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-05-23 00:47:18 +00:00
twanvl f21f11ac87 Support for automatic curly quotes
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@375 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-05-14 18:24:01 +00:00
twanvl 04366b3505 Fixed: custom keywords not immediatly active;
Version bump;
Moved the busy cursor to actual loading of set;

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@364 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-05-13 23:55:37 +00:00
twanvl 6ef60ed15f Icons for export and print;
match_rule script function

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@356 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-05-13 17:27:25 +00:00
twanvl 33fd2b5e18 default smart pointer type switched to intrusive_ptr
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@337 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-05-11 21:34:53 +00:00
twanvl 3b6743b110 Added support for custom colors for graphs;
Moved 'choice colors' from styel to field, split into 'choice colors' and 'choice colors cardlist';
Added support for pie graphs (no gui to use them, though);
Fixed bugs caused by selecting a card before the set was changed on all panels.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@336 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-05-11 14:10:29 +00:00
twanvl e38cc6e2c9 Fixed dependencies for 'styling';
Fixed: specific character prefered over .* for keywords

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@306 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-04-28 21:58:29 +00:00
coppro 7c40df0624 Updated a few GCC issues, and case-sensitivity of filenames.
I had to rename the export function in Apprentice.cpp since "export" is a reserved word according to the C++ standard. I don't know whether GCC supports it yet, but it certainly complains.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@302 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-04-25 00:16:29 +00:00
twanvl a2e709d86b It is 2007 by now
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@275 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-04-21 17:06:29 +00:00