minor tweaks to reduce changes from origin

This commit is contained in:
Jesse Plamondon-Willard 2020-08-29 23:10:29 -04:00
parent 4b53ee366b
commit 9edff95dd5
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 8 additions and 13 deletions

View File

@ -47,11 +47,7 @@ namespace StardewModdingAPI
#endif
/// <summary>The target game platform.</summary>
#if SMAPI_FOR_MOBILE
internal static GamePlatform Platform { get; } = (GamePlatform)Enum.Parse(typeof(GamePlatform), LowLevelEnvironmentUtility.DetectPlatform());
#else
internal static GamePlatform Platform { get; } = (GamePlatform)Enum.Parse(typeof(GamePlatform), LowLevelEnvironmentUtility.DetectPlatform());
#endif
/// <summary>The game's assembly name.</summary>
internal static string GameAssemblyName => EarlyConstants.Platform == GamePlatform.Windows ? "Stardew Valley" : "StardewValley";

View File

@ -505,6 +505,10 @@ namespace StardewModdingAPI.Framework
try
{
/*********
** Safe queued work
*********/
// print warnings/alerts
SCore.DeprecationManager.PrintQueued();
SCore.PerformanceMonitor.PrintQueuedAlerts();
@ -895,19 +899,16 @@ namespace StardewModdingAPI.Framework
*********/
if (state.ActiveMenu.IsChanged)
{
if (this.Monitor.IsVerbose)
this.Monitor.Log($"Context: menu changed from {state.ActiveMenu.Old?.GetType().FullName ?? "none"} to {state.ActiveMenu.New?.GetType().FullName ?? "none"}.");
var was = state.ActiveMenu.Old;
var now = state.ActiveMenu.New;
// raise menu events
#if SMAPI_FOR_MOBILE
IClickableMenu was = state.ActiveMenu.Old;
IClickableMenu now = state.ActiveMenu.New;
if (this.Monitor.IsVerbose)
this.Monitor.Log($"Context: menu changed from {state.ActiveMenu.Old?.GetType().FullName ?? "none"} to {state.ActiveMenu.New?.GetType().FullName ?? "none"}.", LogLevel.Trace);
this.Monitor.Log($"Context: menu changed from {was?.GetType().FullName ?? "none"} to {now?.GetType().FullName ?? "none"}.");
// raise menu events
events.MenuChanged.Raise(new MenuChangedEventArgs(was, now));
#if SMAPI_FOR_MOBILE
if (now is GameMenu gameMenu)
{
foreach (IClickableMenu menu in gameMenu.pages)
@ -934,8 +935,6 @@ namespace StardewModdingAPI.Framework
}
}
events.MenuChanged.Raise(new MenuChangedEventArgs(was, now));
#else
events.MenuChanged.Raise(new MenuChangedEventArgs(state.ActiveMenu.Old, state.ActiveMenu.New));
#endif
}