Add mod merger tool (#168)

This commit is contained in:
Wiseguy
2025-12-31 22:17:44 -05:00
committed by GitHub
parent 98bf104b1b
commit 2b6f05688d
5 changed files with 341 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ struct ModManifest {
std::string game_id;
std::string minimum_recomp_version;
std::unordered_map<std::string, std::vector<std::string>> native_libraries;
bool custom_gamemode = false;
std::vector<toml::table> config_options;
std::vector<std::string> dependencies;
std::vector<std::string> full_dependency_strings;
@@ -367,6 +368,9 @@ ModManifest parse_mod_config_manifest(const std::filesystem::path& basedir, cons
});
}
// Custom gamemode (optional)
ret.custom_gamemode = read_toml_value<bool>(manifest_table, "custom_gamemode", false);
return ret;
}
@@ -546,6 +550,10 @@ void write_manifest(const std::filesystem::path& path, const ModManifest& manife
output_data.emplace("config_schema", toml::table{{"options", std::move(options_array)}});
}
if (manifest.custom_gamemode) {
output_data.emplace("custom_gamemode", manifest.custom_gamemode);
}
toml::json_formatter formatter{output_data, toml::format_flags::indentation | toml::format_flags::indentation};
std::ofstream output_file(path);