Override UserSettings from the commandline
This commit is contained in:
@@ -613,6 +613,8 @@ namespace OpenRA
|
||||
FieldLoader.Load(Settings,
|
||||
new IniFile(FileSystem.Open(settingsFile)).GetSection("Settings"));
|
||||
FileSystem.UnmountAll();
|
||||
|
||||
Settings.AddSettings(settings);
|
||||
}
|
||||
|
||||
static bool quit;
|
||||
|
||||
@@ -52,5 +52,12 @@ namespace OpenRA.GameRules
|
||||
public readonly int ExternalPort = 1234;
|
||||
public readonly bool InternetServer = true;
|
||||
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