diff --git a/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs index a1382ffebb..6d21789266 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs @@ -65,6 +65,8 @@ namespace OpenRA.Mods.Common.UtilityCommands Author = "Westwood Studios" }; + Map.Description = ExtractBriefing(file); + Map.RequiresMod = Game.ModData.Manifest.Mod.Id; SetBounds(Map, mapSection); @@ -114,6 +116,19 @@ namespace OpenRA.Mods.Common.UtilityCommands public abstract void ValidateMapFormat(int format); + static string ExtractBriefing(IniFile file) + { + var briefingSection = file.GetSection("Briefing", true); + if (briefingSection == null) + return string.Empty; + + var briefing = new StringBuilder(); + foreach (var s in briefingSection) + briefing.AppendLine(s.Value); + + return briefing.Replace("\n", " ").ToString(); + } + static void SetBounds(Map map, IniSection mapSection) { var offsetX = Exts.ParseIntegerInvariant(mapSection.GetValue("X", "0"));