Commit Graph

55 Commits

Author SHA1 Message Date
GenevensiS fbf2023848 convert to CRLF line endings 2026-01-05 01:01:18 +01:00
GenevensiS 436c437189 add compiler directives
add compiler directives
2025-12-30 01:18:04 +01:00
GenevensiS dc348b4812 Add to_json and from_json script functions 2025-08-07 18:45:12 +02:00
Twan van Laarhoven c7377303cf Make templates localizable (Closes #100) 2020-10-03 14:38:39 +02:00
Twan van Laarhoven a7c47729c1 Clean up old style angle brackets in nested templates 2020-05-15 02:15:58 +02:00
Twan van Laarhoven e005d47d56 Use std::enable_shared_from_this instead of thisP parameters. 2020-05-06 22:59:10 +02:00
Twan van Laarhoven c00d1f2236 Use script_nil instead of creating ScriptObjects with null pointers.
Fixes #18
2020-05-04 19:58:12 +02:00
Twan van Laarhoven c324c8bbbb to_code now adds quotes around strings.
to_code for map now includes keys.
This maans that the basic script-functions test passes.
2020-04-26 17:35:14 +02:00
Twan van Laarhoven 2e897edbbf Use toSomeType() instead of operator SomeType in ScriptValue.
This means that we are more explicit about type conversions.
Also use override specifiers for overriden virtual functions in ScriptValue.
2020-04-26 17:03:43 +02:00
Twan van Laarhoven 54a3cbfde3 Replace include guards by #pragma once 2020-04-26 01:25:16 +02:00
Twan van Laarhoven bad9981ad9 Cleaned up copyright block.
Removed the year so we don't get tempted to change this ever again.
2020-04-26 01:11:14 +02:00
Twan van Laarhoven 708b4389a0 Use make_intrusive/make_shared for smart pointer construction. 2020-04-25 22:20:51 +02:00
Twan van Laarhoven 4258ce1c6c Remove AColor class, because wxColour now supports alpha values. 2020-04-25 22:20:50 +02:00
Twan van Laarhoven 3b4f3a948c Fix: length now works correctly for maps 2020-04-18 19:32:25 +02:00
Lymia Aluysia 1d912a6853 Update copyright strings. 2017-01-18 08:52:57 -06:00
Lymia Aluysia d2c635f739 Change tabs to two spaces. 2017-01-18 08:43:21 -06:00
twanvl 51dfed69b4 Instead of the new_intrusive<T>() functions, use intrusive(new T)
This means we no longer need 8 different functions for different numbers of arguments, and non-const references can now also be passed to constructors without problems.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1443 0fc631ac-6414-0410-93d0-97cfa31319b6
2010-07-21 14:32:28 +00:00
coppro cf91f9c43b Update copryright date to 2010.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1438 0fc631ac-6414-0410-93d0-97cfa31319b6
2010-03-01 23:33:25 +00:00
coppro f2d6714da9 (sorry for making this all one commit)
Fiddled with the backbone for scripts some more.
VCS are now suppported in sets but configuration/non-svn-systems missing
Linux build now uses precompiled headers (build time--)
A couple warning fixes too.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1427 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-09-16 23:40:44 +00:00
coppro b73f081b60 Updated copyright information (2009 + my real name)
MSE now handles opening more gracefully - can handle directories and failures
Changed behavior to always save cards to separate files with intent to add VCS later (note: shouldn't do this for zip, but can't see a good way to approach this)


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1388 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-06-19 03:09:05 +00:00
twanvl ad5e22e7c5 Added script support for wxDateTime values:
- added ScriptDateTime type
 - added to_date function
 - added date formating support to to_string.
 - documented all of the above.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1348 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-01-11 16:52:07 +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 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 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 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 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 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 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 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 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 c0669fb658 Fixed length function to work correctly for ScriptObjects, in particular for TextValues.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1010 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-06-28 15:13:04 +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 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 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 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 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
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 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 d4af90505a Type name of ScriptObjects is now reported as the actual object type (card/set/value/etc.);
Back trace is slightly smarter
Removed move_cursor_with_sort

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@542 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-10 14:39:28 +00:00
twanvl 801dc3db39 Added functions for blurring and scaling images and changing the alpha value
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@494 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-05 21:58:09 +00:00
twanvl d5c27a4842 Card list colors are determined by a script instead of card_list_colors of a choice field (although that is still the default)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@454 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-30 18:23:38 +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 e287348843 Added 'or else' construct to script language.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@423 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-14 18:31:47 +00:00
twanvl 40e55e8151 scripting language now has support for list and map literals: " [a,b,c] "
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@422 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-14 14:25:53 +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 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
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