Rename ModInformation to ModMetadata
This commit is contained in:
@@ -360,7 +360,7 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
Console.WriteLine("Available mods:");
|
||||
foreach (var mod in ModInformation.AllMods)
|
||||
foreach (var mod in ModMetadata.AllMods)
|
||||
Console.WriteLine("\t{0}: {1} ({2})", mod.Key, mod.Value.Title, mod.Value.Version);
|
||||
|
||||
InitializeWithMod(Settings.Game.Mod, args.GetValue("Launch.Replay", null));
|
||||
@@ -385,7 +385,7 @@ namespace OpenRA
|
||||
orderManager.Dispose();
|
||||
|
||||
// Fall back to default if the mod doesn't exist
|
||||
if (!ModInformation.AllMods.ContainsKey(mod))
|
||||
if (!ModMetadata.AllMods.ContainsKey(mod))
|
||||
mod = new GameSettings().Mod;
|
||||
|
||||
Console.WriteLine("Loading mod: {0}", mod);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA
|
||||
// Describes what is to be loaded in order to run a mod
|
||||
public class Manifest
|
||||
{
|
||||
public readonly ModInformation Mod;
|
||||
public readonly ModMetadata Mod;
|
||||
public readonly string[]
|
||||
Folders, MapFolders, Rules, ServerTraits,
|
||||
Sequences, VoxelSequences, Cursors, Chrome, Assemblies, ChromeLayout,
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA
|
||||
var path = new[] { "mods", mod, "mod.yaml" }.Aggregate(Path.Combine);
|
||||
var yaml = new MiniYaml(null, MiniYaml.FromFile(path)).NodesDict;
|
||||
|
||||
Mod = FieldLoader.Load<ModInformation>(yaml["Metadata"]);
|
||||
Mod = FieldLoader.Load<ModMetadata>(yaml["Metadata"]);
|
||||
Mod.Id = mod;
|
||||
|
||||
// TODO: Use fieldloader
|
||||
|
||||
@@ -14,9 +14,9 @@ using System.Linq;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
public class ModInformation
|
||||
public class ModMetadata
|
||||
{
|
||||
public static readonly Dictionary<string, ModInformation> AllMods = ValidateMods(Directory.GetDirectories("mods").Select(x => x.Substring(5)).ToArray());
|
||||
public static readonly Dictionary<string, ModMetadata> AllMods = ValidateMods(Directory.GetDirectories("mods").Select(x => x.Substring(5)).ToArray());
|
||||
|
||||
public string Id;
|
||||
public string Title;
|
||||
@@ -24,9 +24,9 @@ namespace OpenRA
|
||||
public string Version;
|
||||
public string Author;
|
||||
|
||||
public static Dictionary<string, ModInformation> ValidateMods(string[] mods)
|
||||
public static Dictionary<string, ModMetadata> ValidateMods(string[] mods)
|
||||
{
|
||||
var ret = new Dictionary<string, ModInformation>();
|
||||
var ret = new Dictionary<string, ModMetadata>();
|
||||
foreach (var m in mods)
|
||||
{
|
||||
var yamlPath = new[] { "mods", m, "mod.yaml" }.Aggregate(Path.Combine);
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA
|
||||
if (!yaml.NodesDict.ContainsKey("Metadata"))
|
||||
continue;
|
||||
|
||||
var mod = FieldLoader.Load<ModInformation>(yaml.NodesDict["Metadata"]);
|
||||
var mod = FieldLoader.Load<ModMetadata>(yaml.NodesDict["Metadata"]);
|
||||
mod.Id = m;
|
||||
|
||||
ret.Add(m, mod);
|
||||
@@ -244,7 +244,7 @@
|
||||
<Compile Include="Scripting\ScriptPlayerInterface.cs" />
|
||||
<Compile Include="Traits\Player\FixedColorPalette.cs" />
|
||||
<Compile Include="Primitives\ReadOnlyDictionary.cs" />
|
||||
<Compile Include="ModInformation.cs" />
|
||||
<Compile Include="ModMetadata.cs" />
|
||||
<Compile Include="GameRules\Ruleset.cs" />
|
||||
<Compile Include="GameRules\RulesetCache.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user