add config setting to disable update checks (#202)

This commit is contained in:
Jesse Plamondon-Willard 2016-12-22 11:27:48 -05:00
parent ca3cf89000
commit 90f5233cc7
4 changed files with 14 additions and 3 deletions

View File

@ -4,6 +4,7 @@
See [log](https://github.com/Pathoschild/SMAPI/compare/stable...develop).
For players:
* Added option to disable update checks.
* Fixed error when a mod uses the new reflection API on a missing field or method.
For developers:

View File

@ -3,7 +3,13 @@
/// <summary>Contains user settings from SMAPI's JSON configuration file.</summary>
internal class UserSettings
{
/*********
** Accessors
*********/
/// <summary>Whether to enable development features.</summary>
public bool DeveloperMode { get; set; }
/// <summary>Whether to check if a newer version of SMAPI is available on startup.</summary>
public bool CheckForUpdates { get; set; } = true;
}
}

View File

@ -118,8 +118,10 @@ namespace StardewModdingAPI
if (Program.Settings.DeveloperMode)
{
Program.Monitor.ShowTraceInConsole = true;
Program.Monitor.Log($"SMAPI is running in developer mode. The console may be much more verbose. You can disable developer mode by editing or deleting {Constants.ApiConfigPath}.", LogLevel.Alert);
Program.Monitor.Log($"You configured SMAPI to run in developer mode. The console may be much more verbose. You can disable developer mode by installing the non-developer version of SMAPI, or by editing or deleting {Constants.ApiConfigPath}.", LogLevel.Warn);
}
if (!Program.Settings.CheckForUpdates)
Program.Monitor.Log($"You configured SMAPI to not check for updates. Running an old version of SMAPI is not recommended. You can enable update checks by editing or deleting {Constants.ApiConfigPath}.", LogLevel.Warn);
// initialise legacy log
Log.Monitor = new Monitor("legacy mod", Program.LogFile) { ShowTraceInConsole = Program.Settings.DeveloperMode };
@ -148,7 +150,8 @@ namespace StardewModdingAPI
}
// check for update when game loads
GameEvents.GameLoaded += (sender, e) => Program.CheckForUpdateAsync();
if (Program.Settings.CheckForUpdates)
GameEvents.GameLoaded += (sender, e) => Program.CheckForUpdateAsync();
// launch game
Program.StartGame();

View File

@ -1,3 +1,4 @@
{
"DeveloperMode": true
"DeveloperMode": true,
"CheckForUpdates": true
}