summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md1
-rw-r--r--src/StardewModdingAPI/Framework/UserSettings.cs6
-rw-r--r--src/StardewModdingAPI/Program.cs7
-rw-r--r--src/StardewModdingAPI/StardewModdingAPI.config.json3
4 files changed, 14 insertions, 3 deletions
diff --git a/release-notes.md b/release-notes.md
index 04a9cc04..804d78ba 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -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:
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
}