Commit Graph

77 Commits

Author SHA1 Message Date
GenevensiS 6b1c7488bf ensure image script functions preserve metadata 2026-01-25 15:06:48 +01:00
GenevensiS 436c437189 add compiler directives
add compiler directives
2025-12-30 01:18:04 +01:00
GenevensiS 04a3289755 Add dark icon property 2025-12-05 13:36:09 +01:00
GenevensiS cf0a84a8a7 Card data in images (minimum viable)
* remove wxEmptyString

* improve style tab carousel

* create web request window

* add drop target and drop source
2025-11-28 10:42:30 +01:00
GenevensiS 81e9a1e26f Card data in images (start)
* Add uuid implementation

* Simplify uid implementation

* Check for uid conflicts upon adding/copying cards

* Remove unnecessary checks

these are already checked as part of the first loop, since they were added to set.cards

* Implement card linking

* refactor to avoid triple loop

* Start link visualization

* Continue link visualization

* formatting

* add missing locale entries

* improve layout

* improve UI refresh

* copy links when copying cards

* implement second face editor

* refactor using macros

* get references

* pasting multiple cards and links

* start refactoring editors

* continue refactoring editors

* continue refactoring editors again

* finish refactoring editors

* refresh card list on link editor event

* tweak event handling

* Add insert_image script function

* change parameter type

* add script functions to get cards

* add dimensions_of script function

calculate both dimensions simultaneously while rendering the image only once.

* save value even if not editable

* add get_mse_locale script function

* Change zoom scale choices

* bug fixes

* Scale symbol spacing with font size

* sync locales

* standardize line ending

* handle links in new_card

* initial

waiting on wxWidgets 3.3.1

* update comment

* store rect in image filename

* store rect in temp file name

* Update package.cpp

* change line endings
2025-08-11 16:57:04 +02:00
GenevensiS 3bf9de18b1 Implement unique IDs and card linking 2025-08-11 16:17:13 +02:00
GenevensiS dc348b4812 Add to_json and from_json script functions 2025-08-07 18:45:12 +02:00
GenevensiS e45353af9b Add Json importer (#46)
add boost-json to dependencies
2025-06-21 07:53:35 +02:00
GenevensiS 87fbc0e80e Implement CSV / TSV import (#45)
- add csv/tsv importer
- add `make_map` script function
- add `alt name` field property
- add `construction script` field property
- add `construction script` game property
2025-06-09 04:53:33 +02:00
GenevensiS 616ea3f725 Create slider field type 2025-05-22 12:52:26 +02:00
Brendan Hagan e0d9e84740 feat: restore locale level translations for other packages (fixes #41)
This is only a partial fix though, it basically restores the old behavior as a default. That doesn't help though with flipping the definitions to get stuff out of the UI Locale file though. So that'll have to come next for allowing wildcard resolutions to be done from the game(?) or maybe locale extension files?
2022-08-02 21:42:03 -04:00
Twan van Laarhoven c7377303cf Make templates localizable (Closes #100) 2020-10-03 14:38:39 +02:00
Twan van Laarhoven 4ff603d413 Allow ValueViewers to have a bounding box different from the Style's. This closes #64. 2020-06-01 01:18:13 +02:00
Twan van Laarhoven 83448a1667 Fix #28: correctly track dependencies on card_style._.content / ..layout 2020-05-23 13:57:04 +02:00
Twan van Laarhoven 1c35183839 Consistent order of style property updates.
See #4 (which is mostly fixed by this commit)
2020-05-10 00:20:37 +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 1a39b85b73 (fix comment) 2020-04-27 01:21:18 +02:00
Twan van Laarhoven 40d78edf0f Cleaned up the reflection code a bit
* Renamed 'tag' variable to 'handler'
* Removed addAlias stuff, instead check for matching names with if statements
* Added after_reading function that is called by Reader after reading a complete object. This generalizes Packaged::validate, which is now also called via this mechanism.
* Removed some backwards compatibility with <0.3.0 for templates
2020-04-26 15:33:59 +02:00
Twan van Laarhoven 4bebd48786 Moved tab_index to Style (instead of Field), it makes more sense there, since it pertains to the layout of stuff on the card.
Also don't precalculate list of fields sorted by tab order, just find the next/previous ones on the fly.
2020-04-26 02:16:39 +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 4327abb803 Remove DECLARE_TYPEOF
It is no longer needed since C++11
2020-04-26 00:51:16 +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 713a9e4a40 Use underscores instead of spaces for all internal names. And renamed some script functions at the same time.
* cannocial_name_form now outputs "_", where it used to use " "
* this simplifies reflectio and scripting code, because now C++ names are also MSE internal names
* added 'caption' property to fields. This is used instead of the name in NativeLookEditor, since the latter will now contain underscores.
* renamed text related script functions for consistency, since we were touching that part of the code anyway.
2020-04-22 23:48:26 +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 53bbcfe9a9 Be explicit about type of angles: either Radians or Degrees.
Angles are always doubles.
Internally use radians as much as possible.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1605 0fc631ac-6414-0410-93d0-97cfa31319b6
2011-01-09 14:49:59 +00: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 47aa7ce923 Rename 'cannocial_name_form' to 'canonical_name_form'
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1433 0fc631ac-6414-0410-93d0-97cfa31319b6
2009-12-04 06:04:57 +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 10da8c7175 fix warnings about fabs(Scriptable<double>)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1276 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-12-31 15:25:34 +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
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 e6f466933d More warnings/minor fixes
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@836 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-04-06 18:08:32 +00:00
coppro 692ff43573 Compatibility updates step 1.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@815 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-01-05 22:37:22 +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 3ceec52c1c - no longer try to draw fields with huge or negative size
- download icons of packages

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@799 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-29 23:51:19 +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 d493394519 - Added 'package list' field type
- Some refactoring of the other field types

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@790 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-12-26 23:37: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
twanvl 1dabc07979 Reordered the magic statistics panel
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@717 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-20 19:01:17 +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 bdd3429479 Symbol resizing using aspect ratio;
TODO: copy code for rarity box to other styles

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@622 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-24 02:05:50 +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 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
coppro fa21bee0b1 Added new sort options for special rarity
Added "sort script" field
BUG: Dependencies are not correctly updated for collection sorting, so card numbers don't update properly.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@546 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-10 16:44:43 +00:00
twanvl 55a897e392 Implemented nicer string collation, with support for composed characters and accents;
Fixed symbol filter bug, green was not made transparent;
Slightly nicer error messages when forgeting 'type' keys.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@544 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-10 16:19:36 +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 470fbcb9a7 Fixed: failed to re-prepare text after content dependent script changed
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@482 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-04 22:23: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