From 5548fd1aba244622e53969347da7cbe4d0a72ba8 Mon Sep 17 00:00:00 2001 From: spherallic <spherallic@gmail.com> Date: Sat, 3 Jun 2023 00:09:26 +0200 Subject: [PATCH] Pass folder resources to SRB2 properly, using new launcher parameters --- .../Configurations/Includes/SRB222_common.cfg | 2 +- Source/Core/General/Launcher.cs | 40 +++++++++++++++++++ Source/Core/Windows/ConfigForm.resx | 2 + 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Build/Configurations/Includes/SRB222_common.cfg b/Build/Configurations/Includes/SRB222_common.cfg index 5d14a77ed..a6344d267 100644 --- a/Build/Configurations/Includes/SRB222_common.cfg +++ b/Build/Configurations/Includes/SRB222_common.cfg @@ -15,7 +15,7 @@ common ignoredextensions = "wad pk3 pk7 bak backup1 backup2 backup3 zip rar 7z"; // Default testing parameters - testparameters = "-file \"%AP\" \"%F\" -warp %L"; + testparameters = "-folder \"%AF\" -file \"%AA\" \"%F\" -warp %L"; testshortpaths = true; // Action special help diff --git a/Source/Core/General/Launcher.cs b/Source/Core/General/Launcher.cs index ad71842b9..6dcad1be6 100755 --- a/Source/Core/General/Launcher.cs +++ b/Source/Core/General/Launcher.cs @@ -118,6 +118,8 @@ namespace CodeImp.DoomBuilder DataLocation iwadloc; string p_wp = "", p_wf = ""; string p_ap = "", p_apq = ""; + string p_aa = "", p_aaq = ""; + string p_af = "", p_afq = ""; string p_l1 = "", p_l2 = ""; string p_nm = ""; string f = tempwad; @@ -168,16 +170,46 @@ namespace CodeImp.DoomBuilder { p_ap += General.GetShortFilePath(dl.location) + " "; p_apq += "\"" + General.GetShortFilePath(dl.location) + "\" "; + if (dl.type == DataLocation.RESOURCE_WAD || dl.type == DataLocation.RESOURCE_PK3) + { + p_aa += General.GetShortFilePath(dl.location) + " "; + p_aaq += "\"" + General.GetShortFilePath(dl.location) + "\" "; + } + else + { + p_af += General.GetShortFilePath(dl.location) + " "; + p_afq += "\"" + General.GetShortFilePath(dl.location) + "\" "; + } } else if (linuxpaths) { p_ap += General.GetLinuxFilePath(dl.location) + " "; p_apq += "\"" + General.GetLinuxFilePath(dl.location) + "\" "; + if (dl.type == DataLocation.RESOURCE_WAD || dl.type == DataLocation.RESOURCE_PK3) + { + p_aa += General.GetLinuxFilePath(dl.location) + " "; + p_aaq += "\"" + General.GetLinuxFilePath(dl.location) + "\" "; + } + else + { + p_af += General.GetLinuxFilePath(dl.location) + " "; + p_afq += "\"" + General.GetLinuxFilePath(dl.location) + "\" "; + } } else { p_ap += dl.location + " "; p_apq += "\"" + dl.location + "\" "; + if (dl.type == DataLocation.RESOURCE_WAD || dl.type == DataLocation.RESOURCE_PK3) + { + p_aa += dl.location + " "; + p_aaq += "\"" + dl.location + "\" "; + } + else + { + p_af += dl.location + " "; + p_afq += "\"" + dl.location + "\" "; + } } } } @@ -186,6 +218,10 @@ namespace CodeImp.DoomBuilder // Trim last space from resource file locations p_ap = p_ap.TrimEnd(' '); p_apq = p_apq.TrimEnd(' '); + p_aa = p_aa.TrimEnd(' '); + p_aaq = p_aaq.TrimEnd(' '); + p_af = p_af.TrimEnd(' '); + p_afq = p_afq.TrimEnd(' '); // Try finding the L1 and L2 numbers from the map name string numstr = ""; @@ -250,7 +286,11 @@ namespace CodeImp.DoomBuilder outp = outp.Replace("%L2", p_l2); outp = outp.Replace("%L", General.Map.Options.CurrentName); outp = outp.Replace("\"%AP\"", p_apq); + outp = outp.Replace("\"%AA\"", p_aaq); + outp = outp.Replace("\"%AF\"", p_afq); outp = outp.Replace("%AP", p_ap); + outp = outp.Replace("%AA", p_aa); + outp = outp.Replace("%AF", p_af); outp = outp.Replace("%S", skill.ToString()); outp = outp.Replace("%NM", p_nm); diff --git a/Source/Core/Windows/ConfigForm.resx b/Source/Core/Windows/ConfigForm.resx index b70bfa728..ce6a0dd1a 100755 --- a/Source/Core/Windows/ConfigForm.resx +++ b/Source/Core/Windows/ConfigForm.resx @@ -185,6 +185,8 @@ %L1 - The first number found in the map lump name (as is set in the map options window). %L2 - The second number found in the map lump name (as is set in the map options window). %AP - All resource files, except the first IWAD, with full paths included. +%AA - All archives (WAD and PK3 files), except the first IWAD, with full paths included. +%AF - All folder resources, with full paths included. %S - Skill number at which to test. %NM - Either -nomonsters when testing without monsters, or nothing at all.</value> </data> -- GitLab