diff --git a/CHANGELOG b/CHANGELOG index 6cbaf17db9..648b0c91b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -122,6 +122,7 @@ NEW: Mods can now include traits from TD and D2K in RA. Mods can now customize UI text settings like font type/color/contrast for most widgets and set global defaults in metrics.yaml. New sections MapFolders and Translations added to mod.yaml. + Mods must now explicitly specify the mods that they can inherit maps from by defining `SupportsMapsFrom: parent_mod' in mod.yaml. Renamed CarpetBomb trait to AttackBomber, and additional functionality added. An Armament trait is now required to specify the weapons. Renamed Capture trait to ExternalCapture. Renamed CapturableBar trait to ExternalCapturableBar. diff --git a/OpenRA.FileFormats/Manifest.cs b/OpenRA.FileFormats/Manifest.cs index 22a6fdcf90..df1f8f7428 100644 --- a/OpenRA.FileFormats/Manifest.cs +++ b/OpenRA.FileFormats/Manifest.cs @@ -22,7 +22,7 @@ namespace OpenRA.FileFormats Folders, MapFolders, Rules, ServerTraits, Sequences, VoxelSequences, Cursors, Chrome, Assemblies, ChromeLayout, Weapons, Voices, Notifications, Music, Movies, Translations, TileSets, - ChromeMetrics, PackageContents, LuaScripts; + ChromeMetrics, PackageContents, LuaScripts, MapCompatibility; public readonly Dictionary Packages; public readonly MiniYaml LoadScreen; @@ -69,6 +69,16 @@ namespace OpenRA.FileFormats if (yaml.ContainsKey("TileSize")) TileSize = int.Parse(yaml["TileSize"].Value); + + // Allow inherited mods to import parent maps. + var compat = new List(); + compat.Add(mod); + + if (yaml.ContainsKey("SupportsMapsFrom")) + foreach (var c in yaml["SupportsMapsFrom"].Value.Split(',')) + compat.Add(c.Trim()); + + MapCompatibility = compat.ToArray(); } static string[] YamlList(Dictionary yaml, string key) diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index 1fd39c8017..4e4d071701 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -155,7 +155,7 @@ namespace OpenRA try { var map = new Map(path, Manifest.Mod.Id); - if (map.RequiresMod == Manifest.Mod.Id) + if (Manifest.MapCompatibility.Contains(map.RequiresMod)) ret.Add(map.Uid, map); } catch (Exception e)