From 61d857c41fc2b90cd495c4923251cb1ed472e5ca Mon Sep 17 00:00:00 2001 From: Patrick Müssig Date: Sat, 2 Apr 2022 03:47:52 +0200 Subject: Added support for `--developer-mode true|false` Minimal changes required to enable/disable developer mode via command line argument. This commit does not include any error handling for invalid values how ever they will be ignored and not crash the game. --- src/SMAPI/Framework/SCore.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index b4aa3595..801a7237 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -168,7 +168,8 @@ namespace StardewModdingAPI.Framework /// Construct an instance. /// The path to search for mods. /// Whether to output log messages to the console. - public SCore(string modsPath, bool writeToConsole) + /// null if not modified else whether to use developer mode + public SCore(string modsPath, bool writeToConsole, bool? developerModeValue) { SCore.Instance = this; @@ -183,6 +184,13 @@ namespace StardewModdingAPI.Framework // init basics this.Settings = JsonConvert.DeserializeObject(File.ReadAllText(Constants.ApiConfigPath)); + + // temporary overwrite DeveloperMode Setting + if (developerModeValue.HasValue) + { + this.Settings.DeveloperMode = developerModeValue.Value; + } + if (File.Exists(Constants.ApiUserConfigPath)) JsonConvert.PopulateObject(File.ReadAllText(Constants.ApiUserConfigPath), this.Settings); -- cgit