Add Json importer (#46)

add boost-json to dependencies
This commit is contained in:
GenevensiS
2025-06-21 07:53:35 +02:00
committed by GitHub
parent 128bb3867d
commit e45353af9b
27 changed files with 685 additions and 185 deletions
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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<TextValue>(_("title")) .value = file.ReadLine();
+2 -1
View File
@@ -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);
+2 -1
View File
@@ -42,7 +42,8 @@ public:
IndexMap<FieldP,StyleP> default_set_style; ///< Default style for the set fields, because it is often the same
vector<FieldP> 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<String> json_paths; ///< Paths inside JSON files to find the card array
vector<StatsDimensionP> statistics_dimensions; ///< (Additional) statistics dimensions
vector<StatsCategoryP> statistics_categories; ///< (Additional) statistics categories
vector<PackTypeP> pack_types; ///< Types of random card packs to generate
+4 -4
View File
@@ -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)
{}