summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-12-22 11:27:48 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-12-22 11:27:48 -0500
commit90f5233cc7d8202a89e1878e1183562fe5ba17b9 (patch)
tree70b1459666e9f1461317d779d57abd776e75f14e /src
parentca3cf890008ebcf0557b29004514050484a08001 (diff)
downloadSMAPI-90f5233cc7d8202a89e1878e1183562fe5ba17b9.tar.gz
SMAPI-90f5233cc7d8202a89e1878e1183562fe5ba17b9.tar.bz2
SMAPI-90f5233cc7d8202a89e1878e1183562fe5ba17b9.zip
add config setting to disable update checks (#202)
Diffstat (limited to 'src')
-rw-r--r--src/StardewModdingAPI/Framework/UserSettings.cs6
-rw-r--r--src/StardewModdingAPI/Program.cs7
-rw-r--r--src/StardewModdingAPI/StardewModdingAPI.config.json3
3 files changed, 13 insertions, 3 deletions
diff --git a/src/StardewModdingAPI/Framework/UserSettings.cs b/src/StardewModdingAPI/Framework/UserSettings.cs
index 199d19b3..6a4fb353 100644
--- a/src/StardewModdingAPI/Framework/UserSettings.cs
+++ b/src/StardewModdingAPI/Framework/UserSettings.cs
@@ -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;
}
}
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index e316dbd8..9ecb91e3 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -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();
diff --git a/src/StardewModdingAPI/StardewModdingAPI.config.json b/src/StardewModdingAPI/StardewModdingAPI.config.json
index 771c28e2..2abaf73a 100644
--- a/src/StardewModdingAPI/StardewModdingAPI.config.json
+++ b/src/StardewModdingAPI/StardewModdingAPI.config.json
@@ -1,3 +1,4 @@
{
- "DeveloperMode": true
+ "DeveloperMode": true,
+ "CheckForUpdates": true
}