Commit Graph

380 Commits

Author SHA1 Message Date
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 698d7e1f9f No age is Age(0), so we don't refresh symbols all the time
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@979 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-06 19:03:56 +00:00
twanvl 902a85f113 Allow symbol_variation script function to load images from the stylesheet by filename
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@977 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-05 20:36:20 +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 d00beeb55f Closure operator now behaves as default argument operator, documentation.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@965 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-03 18:33:17 +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 6912dfda09 Simplified script VM:
- removed I_RET instruction, return is now implicit at end of script
 - I_POP is not a binary instruction.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@963 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-03 14:08:11 +00:00
twanvl 5b47f6f498 Improved position reporting of script errors
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@931 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-01 01:07:45 +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 f3ff6f22ae Renamed global PackageManager object to package_manager to reduce confusion
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@907 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-05-31 14:45:04 +00:00
twanvl e61aed5c6b Names of add/remove card/keyword actions
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@868 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-05-18 21:10:13 +00:00
twanvl 8d6af1d37a Fixed some bugs from last commit (typo in SCRIPT_PARAM_DEFAULT_C definition)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@858 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-05-18 17:53:44 +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
twanvl c666e98645 Allow multiple cards to be selected in a card list,
Allow card actions to add/remove multiple cards.
not yet: actually use these multicard actions.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@853 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-05-17 01:51:50 +00:00
twanvl 1b516e781f Script support for AColors. All colors in script related code are now AColor.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@852 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-05-16 20:51:16 +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 abf4da9cff Fixed: rotation adjust code was overwriting scripts;
Fixed: positioning of stretched + rotated text

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@802 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-30 01:53:41 +00:00
twanvl 796975bd9d Added saturate script function (+documentation), it also desaturates
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@800 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-30 00:48:39 +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
twanvl b79f52db84 New rotation system (see forum thread).
Major changes:
  - when rotating, the top left corner of the rectangle stays in place.
  - ValueViewers get a dc that is pre-rotated/translated for them, i.e. (0,0) is the top-left of the viewer (with ValueViewer::getRotation).
  - moved 'angle' from individual Styles to the Style base class.
  - any rotation angle is now possible. angle is still an int for now.

This warrants a version bump

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@782 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-23 21:58:58 +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 36a36356c5 The 'Big Whine' patch:
Any use of a file from another package without a declared dependency will give a warning;

Also added some more _LOCALE_123_ macros so we need less format_string calls

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@753 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-24 20:24:22 +00:00
twanvl 458062fa37 Spelling: availAble;
Added information about what parameter an error occured in;
Conversion to string no longer results in [[typeName()]], it gives an error instead.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@721 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-20 21:52:26 +00:00
twanvl 1f3f4e01fe Added support for named colors, e.g. "white" and "black";
Added missing keys to locale.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@716 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-20 18:16:10 +00:00
twanvl e4f9bf1eac Fixed: "X time counter(s)" for suspend keyword, caused by not adding number hints for non-numeric things;
No longer request thumbnails of missing images

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@714 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-20 17:54:10 +00:00
coppro 99d385eb00 Added some fixes
More work on update window.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@700 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-15 03:38:54 +00:00
twanvl fc44560238 Added 'card' to value actions, this fixes a bug where extra fields get updated with the wrong context, and it should also speed things up.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@673 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-09 00:39:01 +00:00
twanvl bdc1e12e95 Added <prefix> and <suffix> tags;
Added prefix and suffix support to combined_editor;
'always symbol' now checks if the symbols are available in the symbol font;
Fixed parser bug in spec_sort;
A first information field is no longer used as set identification

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@653 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-01 19:56:43 +00:00
twanvl 322e8715fc Fixed: choice images were generated with the wrong context from invalidate()
Choice thumbnails are now checked to not be 'local' before reading from cache, fixes issue with wrong rarity symbol in the drop down list;
Disabled unimplemented menu items;
Multiple choice items for RENDER_LIST are now zoomed, and positioning is on rotated cards is fixed.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@650 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-29 22:52:56 +00:00
twanvl 790e55a35c Fixed 'use zoom and rotation settings when exporting';
Fixed: enabled was not used for default symbol in symbol font;

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@640 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-28 22:35:49 +00:00
twanvl 087af8360d Added <soft> tag that takes up no space for alignment purposes;
used this tag for magic creature types;
Added correct handling of Tribal sub types;
Fixed sort_index use by spoiler export template

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@637 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-28 20:49:25 +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 52ec7b38c0 Images are now cached as wxBitmap, not wxImage. This should improve performance.
Fixed some more corner cases of rotation+zoom.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@630 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-25 21:24:28 +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 dc9f08b311 Some tweaks to word drop down list
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@619 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-23 17:37:44 +00:00
twanvl 9f2b30b2db Added word lists for choosing things like card type;
Added 'in_place' pattern to spec_sort

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@616 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-23 16:33:12 +00:00
twanvl 35bbf36e04 Added validator for locales based on all strings in the source code.
It checks:
 - whether all keys used by the program are in the locale
 - whether the right number of %s are used
 - if there are no extra keys in the locale that shouldn't be there
This will become very useful when translations need to be updated for new MSE versions.

There is a perl script for generating the 'expected_locale_keys' resource file.
This file contains a list of all the locale keys used.
This is a resource and not a data file because it is automatically generated from the code,
 the user has no business modifying it.

I also fixed all the locale errors I found in the process.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@613 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-17 21:10:48 +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
coppro a75366234f Added crop image function.
Fixed 'difference' symbol type.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@574 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-14 03:16:45 +00:00
twanvl d590819762 Removed last of the BeginDrawing/EndDrawing calls;
Added english_number_ordinal script function;
Working on symbols with a different aspect ratio (i.e. wider/smaller symbols)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@558 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-12 17:01:07 +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