prefix OS name in log on Android

This commit is contained in:
Jesse Plamondon-Willard 2020-02-02 15:01:03 -05:00
parent 0a2b15d3c3
commit 4991b4d6af
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,9 @@
* Added support for self-broadcasts through the multiplayer API. (Mods can now send messages to the current machine. That enables simple integrations between mods without needing an API, and lets mods notify a host mod without needing different code depending on whether the current player is the host or a farmhand.)
* Eliminated unneeded network messages when broadcasting to a peer who can't handle the message (e.g. because they don't have SMAPI or don't have the target mod).
* For SMAPI/tool developers:
* The SMAPI log now prefixes the OS name with `Android` on Android.
## 3.2
Released 01 February 2020 for Stardew Valley 1.4.1 or later.

View File

@ -53,7 +53,19 @@ namespace StardewModdingAPI.Toolkit.Utilities
}
catch { }
#endif
return (platform == Platform.Mac ? "MacOS " : "") + Environment.OSVersion;
string name = Environment.OSVersion.ToString();
switch (platform)
{
case Platform.Android:
name = $"Android {name}";
break;
case Platform.Mac:
name = $"MacOS {name}";
break;
}
return name;
}
/// <summary>Get the name of the Stardew Valley executable.</summary>