tweak default settings logic

This commit is contained in:
Jesse Plamondon-Willard 2022-05-07 23:34:30 -04:00
parent e286e5591b
commit 37617e9c26
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 15 additions and 16 deletions

View File

@ -96,19 +96,19 @@ namespace StardewModdingAPI.Framework.Models
/// <param name="logNetworkTraffic">Whether SMAPI should log network traffic.</param>
/// <param name="consoleColors">The colors to use for text written to the SMAPI console.</param>
/// <param name="suppressUpdateChecks">The mod IDs SMAPI should ignore when performing update checks or validating update keys.</param>
public SConfig(bool developerMode, bool checkForUpdates, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, bool verboseLogging, bool? rewriteMods, bool? usePintail, bool? useCaseInsensitivePaths, bool logNetworkTraffic, ColorSchemeConfig consoleColors, string[]? suppressUpdateChecks)
public SConfig(bool developerMode, bool? checkForUpdates, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, bool? verboseLogging, bool? rewriteMods, bool? usePintail, bool? useCaseInsensitivePaths, bool? logNetworkTraffic, ColorSchemeConfig consoleColors, string[]? suppressUpdateChecks)
{
this.DeveloperMode = developerMode;
this.CheckForUpdates = checkForUpdates;
this.ParanoidWarnings = paranoidWarnings ?? (bool)SConfig.DefaultValues[nameof(SConfig.ParanoidWarnings)];
this.UseBetaChannel = useBetaChannel ?? (bool)SConfig.DefaultValues[nameof(SConfig.UseBetaChannel)];
this.CheckForUpdates = checkForUpdates ?? (bool)SConfig.DefaultValues[nameof(this.CheckForUpdates)];
this.ParanoidWarnings = paranoidWarnings ?? (bool)SConfig.DefaultValues[nameof(this.ParanoidWarnings)];
this.UseBetaChannel = useBetaChannel ?? (bool)SConfig.DefaultValues[nameof(this.UseBetaChannel)];
this.GitHubProjectName = gitHubProjectName;
this.WebApiBaseUrl = webApiBaseUrl;
this.VerboseLogging = verboseLogging;
this.RewriteMods = rewriteMods ?? (bool)SConfig.DefaultValues[nameof(SConfig.RewriteMods)];
this.UsePintail = usePintail ?? (bool)SConfig.DefaultValues[nameof(SConfig.UsePintail)];
this.UseCaseInsensitivePaths = useCaseInsensitivePaths ?? (bool)SConfig.DefaultValues[nameof(SConfig.UseCaseInsensitivePaths)];
this.LogNetworkTraffic = logNetworkTraffic;
this.VerboseLogging = verboseLogging ?? (bool)SConfig.DefaultValues[nameof(this.VerboseLogging)];
this.RewriteMods = rewriteMods ?? (bool)SConfig.DefaultValues[nameof(this.RewriteMods)];
this.UsePintail = usePintail ?? (bool)SConfig.DefaultValues[nameof(this.UsePintail)];
this.UseCaseInsensitivePaths = useCaseInsensitivePaths ?? (bool)SConfig.DefaultValues[nameof(this.UseCaseInsensitivePaths)];
this.LogNetworkTraffic = logNetworkTraffic ?? (bool)SConfig.DefaultValues[nameof(this.LogNetworkTraffic)];
this.ConsoleColors = consoleColors;
this.SuppressUpdateChecks = suppressUpdateChecks ?? Array.Empty<string>();
}

View File

@ -40,9 +40,9 @@ copy all the settings, or you may cause bugs due to overridden changes in future
"RewriteMods": true,
/**
* Whether to make SMAPI file APIs case-insensitive, even on Linux.
* Whether to make SMAPI file APIs case-insensitive (even if the filesystem is case-sensitive).
*
* When this is commented out, it'll be true on Android or Linux, and false otherwise.
* If null, it's only enabled on Android and Linux.
*/
"UseCaseInsensitivePaths": null,
@ -58,17 +58,16 @@ copy all the settings, or you may cause bugs due to overridden changes in future
* part of their normal functionality, so these warnings are meaningless without further
* investigation.
*
* When this is commented out, it'll be true for local debug builds and false otherwise.
* If null, it's only enabled for local debug builds.
*/
//"ParanoidWarnings": true,
"ParanoidWarnings": null,
/**
* Whether SMAPI should show newer beta versions as an available update.
*
* When this is commented out, it'll be true if the current SMAPI version is beta, and false
* otherwise.
* If null, it's only enabled if the current SMAPI version is beta.
*/
//"UseBetaChannel": true,
"UseBetaChannel": null,
/**
* SMAPI's GitHub project name, used to perform update checks.