diff --git a/README.md b/README.md
index 8dd34347..7b4fc3db 100644
--- a/README.md
+++ b/README.md
@@ -21,11 +21,11 @@ On windows, the program can be compiled with Visual Studio (recommended) or with
=======
````
-.\vcpkg install pkgconf wxwidgets[fonts] boost-smart-ptr boost-regex boost-logic boost-pool boost-iterator hunspell --triplet=x64-windows-static
+.\vcpkg install pkgconf wxwidgets[fonts] boost-smart-ptr boost-regex boost-logic boost-pool boost-iterator boost-json hunspell --triplet=x64-windows-static
````
and/or
````
-.\vcpkg install pkgconf wxwidgets boost-smart-ptr boost-regex boost-logic boost-pool boost-iterator hunspell --triplet=x86-windows-static
+.\vcpkg install pkgconf wxwidgets boost-smart-ptr boost-regex boost-logic boost-pool boost-iterator boost-json hunspell --triplet=x86-windows-static
````
then, regardless of your choice
````
diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale
index 68ef3aac..f760d76a 100644
--- a/data/en.mse-locale/locale
+++ b/data/en.mse-locale/locale
@@ -841,6 +841,9 @@ error:
can't create file stream: Failed to create file stream: '%s'
can't write image to set: Failed to write image to set: '%s'
can't import image: Failed to import image: '%s'
+ import missing fields:
+ The %s file contains the following entries that could not
+ be imported, because no corresponding card field was found: %s
# Card creation
no field with name: Card doesn't have a field named '%s'
diff --git a/doc/function/new_card.txt b/doc/function/new_card.txt
index 620fd75c..80fa03af 100644
--- a/doc/function/new_card.txt
+++ b/doc/function/new_card.txt
@@ -12,6 +12,7 @@ NOTE: you should use underscores instead of spaces in field names.
--Parameters--
! Parameter Type Description
| @input@ [[type:map]] of field names to field values Field values to set
+| @ignore_field_not_found@ [[type:boolean]] Optional. If set to true, key/value pairs that don't correspond to a card field will be ignored instead of throwing.
--Examples--
> # Create a new card
diff --git a/doc/type/field.txt b/doc/type/field.txt
index cb88089c..a024e7d2 100644
--- a/doc/type/field.txt
+++ b/doc/type/field.txt
@@ -43,10 +43,10 @@ Fields are part of the [[file:style triangle]]:
| @card list name@ [[type:localized string]] field name Alternate name to use for the card list, for example an abbreviation.
| @card list alignment@ [[type:alignment]] @left@ Alignment of the card list column.
| @sort script@ [[type:script]] Alternate way to sort the card list when using this column to sort the list.
-| @construction script@ [[type:script]] Script applied to the value given when creating a card with the new_card function.
+| @import script@ [[type:script]] Script applied to the value given when creating a card with the new_card function. The script may return a map from field names to values.
For example, the pt field should not be initialized directly, since it is a combination of the power field and toughness field.
So if a value is given for pt, it must be redirected to power and toughness like so: {split := split_text(value, match:"/"); [power:split[0], toughness:split[1]]}.
- The script must return a map from field names to values. Use the make_map function to dynamically create maps.
+ Use the make_map function to dynamically create maps.
The @type@ determines what values of this field contain:
! Type Values contain Displayed as
diff --git a/doc/type/game.txt b/doc/type/game.txt
index 4aaf4bd4..f47ecff7 100644
--- a/doc/type/game.txt
+++ b/doc/type/game.txt
@@ -33,7 +33,7 @@ Such a package contains a [[file:format|data file]] called game that ha
| @default set style@ [[type:indexmap]] of [[type:style]]s Default style for the set fields, can be overridden by the stylesheet.
| @card fields@ [[type:list]] of [[type:field]]s Fields for each card.
| @card list color script@ [[type:script]] from fields Script that determines the color of an item in the card list.
If not set uses the @card list colors@ property of the first card field that has it.
-| @construction script@ [[type:script]] Script that is applied as the last step in the creation of a card in the new_card function. Must return a map from field names to values. Use the make_map function to dynamically create maps.
+| @import script@ [[type:script]] Script that is applied as the last step in the creation of a card in the new_card function. Must return a map from field names to values. Use the make_map function to dynamically create maps.
| @statistics dimensions@ [[type:list]] of [[type:statistics dimension]]s from fields Dimensions for statistics, a dimension is roughly the same as an axis.
By default all card fields with 'show statistics' set to true are used.
| @statistics categories@ [[type:list]] of [[type:statistics category]]s from dimensions DOC_MSE_VERSION: not used since 0.3.6
Choices shown on the statistics panel.
By default all statistics dimensions are used.
diff --git a/doc/type/locale.txt b/doc/type/locale.txt
index d943204f..280e5624 100644
--- a/doc/type/locale.txt
+++ b/doc/type/locale.txt
@@ -61,5 +61,5 @@ To translate the MSE user interface:
* Add new keys for game, stylesheet or symbol font specific keys as described above.
* Save the file, select the new locale from Edit->Preferences.
* Restart MSE, and make sure everything looks right.
-* Submit the new locale to the [[http://magicseteditor.sourceforge.net/forum/7|MSE forum].
+* Submit the new locale as a pull request to the [[https://github.com/MagicSetEditorPacks/Full-Magic-Pack|Full-Magic-Pack repository].
* Maintain the locale when new versions of MSE come out. A new version may have new user interface items and therefore new keys.
diff --git a/src/data/field.cpp b/src/data/field.cpp
index 4b1430ab..168b9f04 100644
--- a/src/data/field.cpp
+++ b/src/data/field.cpp
@@ -40,7 +40,7 @@ Field::~Field() {}
void Field::initDependencies(Context& ctx, const Dependency& dep) const {
sort_script.initDependencies(ctx, dep);
- construction_script.initDependencies(ctx, dep);
+ import_script.initDependencies(ctx, dep);
}
IMPLEMENT_REFLECTION(Field) {
@@ -64,7 +64,7 @@ IMPLEMENT_REFLECTION(Field) {
REFLECT(card_list_allow);
REFLECT_LOCALIZED(card_list_name);
REFLECT(sort_script);
- REFLECT(construction_script);
+ REFLECT(import_script);
REFLECT_N("card_list_alignment", card_list_align);
}
diff --git a/src/data/field.hpp b/src/data/field.hpp
index e11e1b1e..23db0ae7 100644
--- a/src/data/field.hpp
+++ b/src/data/field.hpp
@@ -60,7 +60,7 @@ public:
LocalizedString card_list_name; ///< Name to use in card list.
Alignment card_list_align; ///< Alignment of the card list colummn.
OptionalScript sort_script; ///< The script to use when sorting this, if not the value.
- OptionalScript construction_script; ///< The script to apply to the supplied value, when creating a new card.
+ OptionalScript import_script; ///< The script to apply to the supplied value, when creating a new card.
Dependencies dependent_scripts; ///< Scripts that depend on values of this field
String package_relative_filename;
diff --git a/src/data/format/mse1.cpp b/src/data/format/mse1.cpp
index 9d721104..4cff5cc5 100644
--- a/src/data/format/mse1.cpp
+++ b/src/data/format/mse1.cpp
@@ -51,7 +51,7 @@ SetP MSE1FileFormat::importSet(const String& filename) {
// file version check
String format = file.ReadLine();
if (format.substr(0,8) != _("MTG Set8")) {
- throw ParseError(_("Expected MSE format version 8\nTo convert files made with older versions of Magic Set Editor:\n 1. Download the latest version 1 from http:://magicsetedtitor.sourceforge.net\n 2. Open the set, then save the set\n 3. Try to open them again in this program."));
+ throw ParseError(_("Expected MSE format version 8\nTo convert files made with older versions of Magic Set Editor:\n 1. Download the latest version 1 from https://magicseteditor.boards.net/page/downloads\n 2. Open the set, then save the set\n 3. Try to open them again in this program."));
}
// read general info
set->value(_("title")) .value = file.ReadLine();
diff --git a/src/data/game.cpp b/src/data/game.cpp
index 09edff55..b588bba1 100644
--- a/src/data/game.cpp
+++ b/src/data/game.cpp
@@ -49,7 +49,8 @@ IMPLEMENT_REFLECTION(Game) {
REFLECT_NO_SCRIPT(default_set_style);
REFLECT_NO_SCRIPT(card_fields);
REFLECT_NO_SCRIPT(card_list_color_script);
- REFLECT_NO_SCRIPT(construction_script);
+ REFLECT_NO_SCRIPT(import_script);
+ REFLECT_NO_SCRIPT(json_paths);
REFLECT_NO_SCRIPT(statistics_dimensions);
REFLECT_NO_SCRIPT(statistics_categories);
REFLECT_COMPAT(<308, "pack_item", pack_types);
diff --git a/src/data/game.hpp b/src/data/game.hpp
index 07b6dff7..43852209 100644
--- a/src/data/game.hpp
+++ b/src/data/game.hpp
@@ -42,7 +42,8 @@ public:
IndexMap default_set_style; ///< Default style for the set fields, because it is often the same
vector card_fields; ///< Fields on each card
OptionalScript card_list_color_script; ///< Script that determines the color of items in the card list
- OptionalScript construction_script; ///< Script applied as the last step of the new_card function
+ OptionalScript import_script; ///< Script applied as the last step of the new_card function
+ vector json_paths; ///< Paths inside JSON files to find the card array
vector statistics_dimensions; ///< (Additional) statistics dimensions
vector statistics_categories; ///< (Additional) statistics categories
vector pack_types; ///< Types of random card packs to generate
diff --git a/src/data/settings.cpp b/src/data/settings.cpp
index 6f9f5bc2..da8b68d0 100644
--- a/src/data/settings.cpp
+++ b/src/data/settings.cpp
@@ -178,13 +178,13 @@ Settings::Settings()
, internal_scale (1.0)
, internal_image_extension(true)
#if USE_OLD_STYLE_UPDATE_CHECKER
- , updates_url (_("http://magicseteditor.sourceforge.net/updates"))
+ , updates_url (_("https://magicseteditor.boards.net/page/downloads"))
#endif
- , package_versions_url (_("http://magicseteditor.sourceforge.net/packages"))
- , installer_list_url (_("http://magicseteditor.sourceforge.net/installers"))
+ , package_versions_url (_("https://magicseteditor.boards.net/page/downloads"))
+ , installer_list_url (_("https://magicseteditor.boards.net/page/downloads"))
, check_updates (CHECK_IF_CONNECTED)
, check_updates_all (true)
- , website_url (_("http://magicseteditor.sourceforge.net/"))
+ , website_url (_("https://magicseteditor.boards.net/"))
, install_type (INSTALL_DEFAULT)
{}
diff --git a/src/gui/about_window.cpp b/src/gui/about_window.cpp
index af99fb4a..ee75fb9b 100644
--- a/src/gui/about_window.cpp
+++ b/src/gui/about_window.cpp
@@ -33,7 +33,7 @@ void AboutWindow::onPaint(wxPaintEvent& ev) {
draw(dc);
}
-const char* MSE_AUTHORS[] = {"Twan van Laarhoven (twanvl)", "Sean Hunt (coppro)", "Alissa Rao (Lymia)", "haganbmj", "CaiCai (247321453)"};
+const char* MSE_AUTHORS[] = {"Twan van Laarhoven (twanvl)", "Sean Hunt (coppro)", "Alissa Rao (Lymia)", "haganbmj", "CaiCai (247321453)", "Olivier Bocksberger (GenevensiS)" };
void AboutWindow::draw(DC& dc) {
wxSize ws = GetClientSize();
diff --git a/src/gui/add_csv_window.cpp b/src/gui/add_csv_window.cpp
index bf293e81..893ae061 100644
--- a/src/gui/add_csv_window.cpp
+++ b/src/gui/add_csv_window.cpp
@@ -10,13 +10,14 @@
#include
#include
#include
+#include
#include
#include
#include
#include
-#include
-#include
#include
+#include
+#include