From ef0e7a575ac0c6d6377956a98200699267c673fd Mon Sep 17 00:00:00 2001 From: LittleCube Date: Thu, 19 Dec 2024 13:47:53 -0500 Subject: [PATCH] implement nrm filename toml input --- RecompModTool/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/RecompModTool/main.cpp b/RecompModTool/main.cpp index a632dd2..bfa7543 100644 --- a/RecompModTool/main.cpp +++ b/RecompModTool/main.cpp @@ -35,6 +35,7 @@ struct ModManifest { struct ModInputs { std::filesystem::path elf_path; + std::string nrm_name; std::filesystem::path func_reference_syms_file_path; std::vector data_reference_syms_file_paths; std::vector additional_files; @@ -316,6 +317,15 @@ ModInputs parse_mod_config_inputs(const std::filesystem::path& basedir, const to throw toml::parse_error("Mod toml input section is missing elf file", inputs_table.source()); } + // Output NRM file + std::optional nrm_name_opt = inputs_table["nrm_name"].value(); + if (nrm_name_opt.has_value()) { + ret.nrm_name = std::move(nrm_name_opt.value()); + } + else { + throw toml::parse_error("Mod toml input section is missing the output NRM filename", inputs_table.source()); + } + // Function reference symbols file std::optional func_reference_syms_file_opt = inputs_table["func_reference_syms_file"].value(); if (func_reference_syms_file_opt.has_value()) { @@ -879,7 +889,7 @@ N64Recomp::Context build_mod_context(const N64Recomp::Context& input_context, bo } bool create_mod_zip(const std::filesystem::path& output_dir, const ModConfig& config) { - std::filesystem::path output_path = output_dir / (config.manifest.mod_id + "-" + config.manifest.version_string + ".nrm"); + std::filesystem::path output_path = output_dir / (config.inputs.nrm_name + ".nrm"); #ifdef _WIN32 std::filesystem::path temp_zip_path = output_path;