diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index ea3adcfc22..fd6b5545c9 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -408,6 +408,8 @@ namespace OpenRA root.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f))); } + root.Add(new MiniYamlNode("Videos", FieldSaver.SaveDifferences(Videos, new MapVideos()))); + root.Add(new MiniYamlNode("Options", FieldSaver.SaveDifferences(Options, new MapOptions()))); root.Add(new MiniYamlNode("Players", null, diff --git a/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs b/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs index ad08442540..9339342826 100644 --- a/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs +++ b/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs @@ -157,6 +157,8 @@ namespace OpenRA.Mods.Common.UtilityCommands map.MapResources = Exts.Lazy(() => new CellLayer(TileShape.Rectangle, size)); map.MapTiles = Exts.Lazy(() => new CellLayer(TileShape.Rectangle, size)); + map.Videos = new MapVideos(); + map.Options = new MapOptions(); if (legacyMapFormat == IniMapFormat.RedAlert) @@ -174,6 +176,7 @@ namespace OpenRA.Mods.Common.UtilityCommands ReadCncTrees(file); } + LoadVideos(file, "BASIC"); LoadActors(file, "STRUCTURES"); LoadActors(file, "UNITS"); LoadActors(file, "INFANTRY"); @@ -502,5 +505,33 @@ namespace OpenRA.Mods.Common.UtilityCommands map.Players.Add(section, pr); } + + void LoadVideos(IniFile file, string section) + { + foreach (var s in file.GetSection(section)) + { + if (s.Value != "x" && s.Value != "") + { + switch (s.Key) + { + case "Intro": + map.Videos.BackgroundInfo = s.Value.ToLower() + ".vqa"; + break; + case "Brief": + map.Videos.Briefing = s.Value.ToLower() + ".vqa"; + break; + case "Action": + map.Videos.GameStart = s.Value.ToLower() + ".vqa"; + break; + case "Win": + map.Videos.GameWon = s.Value.ToLower() + ".vqa"; + break; + case "Lose": + map.Videos.GameLost = s.Value.ToLower() + ".vqa"; + break; + } + } + } + } } }