From 91a7fb5be77d049881bd4448f984631f5d09d353 Mon Sep 17 00:00:00 2001 From: Jaron Date: Thu, 16 May 2024 21:04:48 -0500 Subject: [PATCH] Add option to preserve scenario tag name with portmultiplayerscenario --- .../Commands/Porting/PortMultiplayerScenarioCommand.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TagTool/Commands/Porting/PortMultiplayerScenarioCommand.cs b/TagTool/Commands/Porting/PortMultiplayerScenarioCommand.cs index 0e0f6db6..c2e56235 100644 --- a/TagTool/Commands/Porting/PortMultiplayerScenarioCommand.cs +++ b/TagTool/Commands/Porting/PortMultiplayerScenarioCommand.cs @@ -38,8 +38,10 @@ public enum MultiplayerScenarioConversionFlags SpawnPoint = (1 << 5), [Description("Keep path finding data")] PathFinding = (1 << 6), + [Description("Ported scenario will use levels\\custom\\")] + CustomScenarioPath = (1 << 7), - Default = Objects | DeviceObjects | SpawnPoint + Default = Objects | DeviceObjects | SpawnPoint | CustomScenarioPath } public PortMultiplayerScenarioCommand(GameCacheHaloOnlineBase cacheContext, GameCache blamCache, PortTagCommand portTag) : @@ -104,7 +106,10 @@ public override object Execute(List args) if (!Regex.IsMatch(scenarioName, "[a-z0-9_]+")) return new TagToolError(CommandError.CustomMessage, "Scenario name must consist of lowercase alphanumeric characters and underscores"); - scenarioPath = $@"levels\custom\{scenarioName}\{scenarioName}"; + if (conversionFlags.HasFlag(MultiplayerScenarioConversionFlags.CustomScenarioPath)) + scenarioPath = $@"levels\custom\{scenarioName}\{scenarioName}"; + else + scenarioPath = blamScnrTag.Name; // // try to parse the map id, if not use the randomly generated one unless it's actually invalid/out of range