summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-21 20:33:08 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-21 20:33:08 -0500
commit52f4df3f301ecde85a76e10ea9ddd607ab7a1b79 (patch)
tree5fb481d93ea0aae442ac655c96c1044825c1a475 /src
parent0d7d4476004d33b395d6df81386e4159d8898027 (diff)
downloadSMAPI-52f4df3f301ecde85a76e10ea9ddd607ab7a1b79.tar.gz
SMAPI-52f4df3f301ecde85a76e10ea9ddd607ab7a1b79.tar.bz2
SMAPI-52f4df3f301ecde85a76e10ea9ddd607ab7a1b79.zip
add new game build number to the SMAPI log
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Constants.cs11
-rw-r--r--src/SMAPI/Framework/Logging/LogManager.cs2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs
index 5de28f84..c86acd0a 100644
--- a/src/SMAPI/Constants.cs
+++ b/src/SMAPI/Constants.cs
@@ -340,5 +340,16 @@ namespace StardewModdingAPI
// if save doesn't exist yet, return the default one we expect to be created
return folder;
}
+
+ /// <summary>Get a display label for the game's build number.</summary>
+ internal static string GetBuildVersionLabel()
+ {
+ string version = typeof(Game1).Assembly.GetName().Version?.ToString() ?? "unknown";
+
+ if (version.StartsWith($"{Game1.version}."))
+ version = version.Substring(Game1.version.Length + 1);
+
+ return version;
+ }
}
}
diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs
index ef89c751..90433c37 100644
--- a/src/SMAPI/Framework/Logging/LogManager.cs
+++ b/src/SMAPI/Framework/Logging/LogManager.cs
@@ -262,7 +262,7 @@ namespace StardewModdingAPI.Framework.Logging
public void LogIntro(string modsPath, IDictionary<string, object> customSettings)
{
// log platform
- this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Constants.GameVersion} on {EnvironmentUtility.GetFriendlyPlatformName(Constants.Platform)}", LogLevel.Info);
+ this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Constants.GameVersion} (build {Constants.GetBuildVersionLabel()}) on {EnvironmentUtility.GetFriendlyPlatformName(Constants.Platform)}", LogLevel.Info);
// log basic info
this.Monitor.Log($"Mods go here: {modsPath}", LogLevel.Info);