From 76e5588f02b247204969efb488c3fb293601faeb Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 9 Nov 2022 21:41:04 -0500 Subject: add option to disable console input --- src/SMAPI/Framework/Models/SConfig.cs | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src/SMAPI/Framework/Models') diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs index bceb0940..825ebb44 100644 --- a/src/SMAPI/Framework/Models/SConfig.cs +++ b/src/SMAPI/Framework/Models/SConfig.cs @@ -16,6 +16,7 @@ namespace StardewModdingAPI.Framework.Models private static readonly IDictionary DefaultValues = new Dictionary { [nameof(CheckForUpdates)] = true, + [nameof(ListenForConsoleInput)] = true, [nameof(ParanoidWarnings)] = Constants.IsDebugBuild, [nameof(UseBetaChannel)] = Constants.ApiVersion.IsPrerelease(), [nameof(GitHubProjectName)] = "Pathoschild/SMAPI", @@ -48,6 +49,9 @@ namespace StardewModdingAPI.Framework.Models /// Whether to check for newer versions of SMAPI and mods on startup. public bool CheckForUpdates { get; set; } + /// Whether SMAPI should listen for console input to support console commands. + public bool ListenForConsoleInput { get; set; } + /// Whether to add a section to the 'mod issues' list for mods which which directly use potentially sensitive .NET APIs like file or shell access. public bool ParanoidWarnings { get; set; } @@ -87,23 +91,25 @@ namespace StardewModdingAPI.Framework.Models ** Public methods ********/ /// Construct an instance. - /// Whether to enable development features. - /// Whether to check for newer versions of SMAPI and mods on startup. - /// Whether to add a section to the 'mod issues' list for mods which which directly use potentially sensitive .NET APIs like file or shell access. - /// Whether to show beta versions as valid updates. - /// SMAPI's GitHub project name, used to perform update checks. - /// The base URL for SMAPI's web API, used to perform update checks. - /// The log contexts for which to enable verbose logging, which may show a lot more information to simplify troubleshooting. - /// Whether SMAPI should rewrite mods for compatibility. - /// >Whether to make SMAPI file APIs case-insensitive, even on Linux. - /// Whether SMAPI should log network traffic. - /// The colors to use for text written to the SMAPI console. - /// Whether to prevent mods from enabling Harmony's debug mode, which impacts performance and creates a file on your desktop. Debug mode should never be enabled by a released mod. - /// The mod IDs SMAPI should ignore when performing update checks or validating update keys. - public SConfig(bool developerMode, bool? checkForUpdates, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, string[]? verboseLogging, bool? rewriteMods, bool? useCaseInsensitivePaths, bool? logNetworkTraffic, ColorSchemeConfig consoleColors, bool? suppressHarmonyDebugMode, string[]? suppressUpdateChecks) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public SConfig(bool developerMode, bool? checkForUpdates, bool? listenForConsoleInput, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, string[]? verboseLogging, bool? rewriteMods, bool? useCaseInsensitivePaths, bool? logNetworkTraffic, ColorSchemeConfig consoleColors, bool? suppressHarmonyDebugMode, string[]? suppressUpdateChecks) { this.DeveloperMode = developerMode; this.CheckForUpdates = checkForUpdates ?? (bool)SConfig.DefaultValues[nameof(this.CheckForUpdates)]; + this.ListenForConsoleInput = listenForConsoleInput ?? (bool)SConfig.DefaultValues[nameof(this.ListenForConsoleInput)]; this.ParanoidWarnings = paranoidWarnings ?? (bool)SConfig.DefaultValues[nameof(this.ParanoidWarnings)]; this.UseBetaChannel = useBetaChannel ?? (bool)SConfig.DefaultValues[nameof(this.UseBetaChannel)]; this.GitHubProjectName = gitHubProjectName; -- cgit