Rework mod searching/enumeration.
This commit is contained in:
@@ -249,10 +249,10 @@ namespace OpenRA
|
||||
// Special case handling of Game.Mod argument: if it matches a real filesystem path
|
||||
// then we use this to override the mod search path, and replace it with the mod id
|
||||
var modArgument = args.GetValue("Game.Mod", null);
|
||||
string customModPath = null;
|
||||
var explicitModPaths = new string[0];
|
||||
if (modArgument != null && (File.Exists(modArgument) || Directory.Exists(modArgument)))
|
||||
{
|
||||
customModPath = modArgument;
|
||||
explicitModPaths = new[] { modArgument };
|
||||
args.ReplaceValue("Game.Mod", Path.GetFileNameWithoutExtension(modArgument));
|
||||
}
|
||||
|
||||
@@ -314,7 +314,8 @@ namespace OpenRA
|
||||
|
||||
GlobalChat = new GlobalChat();
|
||||
|
||||
Mods = new InstalledMods(customModPath);
|
||||
var modSearchPaths = new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") };
|
||||
Mods = new InstalledMods(modSearchPaths, explicitModPaths);
|
||||
Console.WriteLine("Internal mods:");
|
||||
foreach (var mod in Mods)
|
||||
Console.WriteLine("\t{0}: {1} ({2})", mod.Key, mod.Value.Metadata.Title, mod.Value.Metadata.Version);
|
||||
|
||||
Reference in New Issue
Block a user