Small refactoring in Manifest.cs
This commit is contained in:
@@ -29,7 +29,7 @@ namespace OpenRA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Describes what is to be loaded in order to run a mod
|
/// <summary> Describes what is to be loaded in order to run a mod. </summary>
|
||||||
public class Manifest
|
public class Manifest
|
||||||
{
|
{
|
||||||
public static readonly Dictionary<string, Manifest> AllMods = LoadMods();
|
public static readonly Dictionary<string, Manifest> AllMods = LoadMods();
|
||||||
@@ -106,12 +106,10 @@ namespace OpenRA
|
|||||||
RequiresMods = yaml["RequiresMods"].ToDictionary(my => my.Value);
|
RequiresMods = yaml["RequiresMods"].ToDictionary(my => my.Value);
|
||||||
|
|
||||||
// Allow inherited mods to import parent maps.
|
// Allow inherited mods to import parent maps.
|
||||||
var compat = new List<string>();
|
var compat = new List<string> { Mod.Id };
|
||||||
compat.Add(mod);
|
|
||||||
|
|
||||||
if (yaml.ContainsKey("SupportsMapsFrom"))
|
if (yaml.ContainsKey("SupportsMapsFrom"))
|
||||||
foreach (var c in yaml["SupportsMapsFrom"].Value.Split(','))
|
compat.AddRange(yaml["SupportsMapsFrom"].Value.Split(',').Select(c => c.Trim()));
|
||||||
compat.Add(c.Trim());
|
|
||||||
|
|
||||||
MapCompatibility = compat.ToArray();
|
MapCompatibility = compat.ToArray();
|
||||||
|
|
||||||
@@ -198,6 +196,7 @@ namespace OpenRA
|
|||||||
|
|
||||||
static Dictionary<string, Manifest> LoadMods()
|
static Dictionary<string, Manifest> LoadMods()
|
||||||
{
|
{
|
||||||
|
// Get mods that are in the game folder.
|
||||||
var basePath = Platform.ResolvePath(".", "mods");
|
var basePath = Platform.ResolvePath(".", "mods");
|
||||||
var mods = Directory.GetDirectories(basePath)
|
var mods = Directory.GetDirectories(basePath)
|
||||||
.Select(x => x.Substring(basePath.Length + 1));
|
.Select(x => x.Substring(basePath.Length + 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user