Override UserSettings from the commandline
This commit is contained in:
@@ -612,7 +612,9 @@ namespace OpenRA
|
|||||||
if (FileSystem.Exists(settingsFile))
|
if (FileSystem.Exists(settingsFile))
|
||||||
FieldLoader.Load(Settings,
|
FieldLoader.Load(Settings,
|
||||||
new IniFile(FileSystem.Open(settingsFile)).GetSection("Settings"));
|
new IniFile(FileSystem.Open(settingsFile)).GetSection("Settings"));
|
||||||
FileSystem.UnmountAll();
|
FileSystem.UnmountAll();
|
||||||
|
|
||||||
|
Settings.AddSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool quit;
|
static bool quit;
|
||||||
|
|||||||
@@ -52,5 +52,12 @@ namespace OpenRA.GameRules
|
|||||||
public readonly int ExternalPort = 1234;
|
public readonly int ExternalPort = 1234;
|
||||||
public readonly bool InternetServer = true;
|
public readonly bool InternetServer = true;
|
||||||
public readonly string MasterServer = "http://open-ra.org/master/";
|
public readonly string MasterServer = "http://open-ra.org/master/";
|
||||||
|
|
||||||
|
public void AddSettings(Settings settings)
|
||||||
|
{
|
||||||
|
foreach (var f in this.GetType().GetFields())
|
||||||
|
if (settings.Contains(f.Name))
|
||||||
|
OpenRA.FileFormats.FieldLoader.LoadField( this, f.Name, settings.GetValue(f.Name, "") );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user