diff options
21 files changed, 23 insertions, 25 deletions
diff --git a/src/SMAPI.Installer/Enums/ScriptAction.cs b/src/SMAPI.Installer/Enums/ScriptAction.cs index e62b2a7c..27f649a6 100644 --- a/src/SMAPI.Installer/Enums/ScriptAction.cs +++ b/src/SMAPI.Installer/Enums/ScriptAction.cs @@ -9,4 +9,4 @@ /// <summary>Remove SMAPI from the game directory.</summary> Uninstall } -}
\ No newline at end of file +} diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index dc96e2e8..d0ef0b8d 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -35,8 +35,6 @@ namespace StardewModdingApi.Installer "SMAPI.ConsoleCommands" }; - - /// <summary>Get the absolute file or folder paths to remove when uninstalling SMAPI.</summary> /// <param name="installDir">The folder for Stardew Valley and SMAPI.</param> /// <param name="modsDir">The folder for SMAPI mods.</param> @@ -84,6 +82,7 @@ namespace StardewModdingApi.Installer foreach (DirectoryInfo modDir in modsDir.EnumerateDirectories()) yield return Path.Combine(modDir.FullName, ".cache"); // 1.4–1.7 } + yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley", "ErrorLogs"); // remove old log files } diff --git a/src/SMAPI.Installer/Program.cs b/src/SMAPI.Installer/Program.cs index dc6c97f4..6c479621 100644 --- a/src/SMAPI.Installer/Program.cs +++ b/src/SMAPI.Installer/Program.cs @@ -3,8 +3,6 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.IO.Compression; using System.Reflection; -using StardewModdingAPI.Internal; -using StardewModdingAPI.Toolkit.Utilities; namespace StardewModdingApi.Installer { diff --git a/src/SMAPI/Events/ChangeType.cs b/src/SMAPI/Events/ChangeType.cs index 4b207f08..0fc717df 100644 --- a/src/SMAPI/Events/ChangeType.cs +++ b/src/SMAPI/Events/ChangeType.cs @@ -12,4 +12,4 @@ namespace StardewModdingAPI.Events /// <summary>The stack size changed.</summary> StackChange } -}
\ No newline at end of file +} diff --git a/src/SMAPI/Events/WarpedEventArgs.cs b/src/SMAPI/Events/WarpedEventArgs.cs index 95c53ad9..9afe4a4e 100644 --- a/src/SMAPI/Events/WarpedEventArgs.cs +++ b/src/SMAPI/Events/WarpedEventArgs.cs @@ -22,7 +22,6 @@ namespace StardewModdingAPI.Events public bool IsLocalPlayer => this.Player.IsLocalPlayer; - /********* ** Public methods *********/ diff --git a/src/SMAPI/Framework/CommandManager.cs b/src/SMAPI/Framework/CommandManager.cs index 2b91d394..4a99fd4d 100644 --- a/src/SMAPI/Framework/CommandManager.cs +++ b/src/SMAPI/Framework/CommandManager.cs @@ -119,6 +119,7 @@ namespace StardewModdingAPI.Framework command.Callback.Invoke(name, arguments); return true; } + return false; } diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs index 479ffa7f..d1021cad 100644 --- a/src/SMAPI/Framework/ContentCoordinator.cs +++ b/src/SMAPI/Framework/ContentCoordinator.cs @@ -9,7 +9,6 @@ using Microsoft.Xna.Framework.Content; using StardewModdingAPI.Framework.Content; using StardewModdingAPI.Framework.ContentManagers; using StardewModdingAPI.Framework.Reflection; -using StardewModdingAPI.Framework.StateTracking.Comparers; using StardewModdingAPI.Metadata; using StardewModdingAPI.Toolkit.Serialization; using StardewModdingAPI.Toolkit.Utilities; diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs index a8de013a..6bc3a505 100644 --- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs @@ -76,7 +76,7 @@ namespace StardewModdingAPI.Framework.ContentManagers /// <param name="onDisposing">A callback to invoke when the content manager is being disposed.</param> /// <param name="isNamespaced">Whether this content manager handles managed asset keys (e.g. to load assets from a mod folder).</param> protected BaseContentManager(string name, IServiceProvider serviceProvider, string rootDirectory, CultureInfo currentCulture, ContentCoordinator coordinator, IMonitor monitor, Reflector reflection, Action<BaseContentManager> onDisposing, bool isNamespaced) - : base(serviceProvider, rootDirectory, currentCulture) + : base(serviceProvider, rootDirectory, currentCulture) { // init this.Name = name; diff --git a/src/SMAPI/Framework/DeprecationLevel.cs b/src/SMAPI/Framework/DeprecationLevel.cs index c0044053..12b50952 100644 --- a/src/SMAPI/Framework/DeprecationLevel.cs +++ b/src/SMAPI/Framework/DeprecationLevel.cs @@ -12,4 +12,4 @@ namespace StardewModdingAPI.Framework /// <summary>The code will be removed soon. Deprecation messages should be warnings in the console.</summary> PendingRemoval } -}
\ No newline at end of file +} diff --git a/src/SMAPI/Framework/DeprecationManager.cs b/src/SMAPI/Framework/DeprecationManager.cs index 11fae0b2..94a2da85 100644 --- a/src/SMAPI/Framework/DeprecationManager.cs +++ b/src/SMAPI/Framework/DeprecationManager.cs @@ -107,6 +107,7 @@ namespace StardewModdingAPI.Framework } } } + this.QueuedWarnings.Clear(); } diff --git a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs index a0119bf8..1150d641 100644 --- a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs +++ b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs @@ -96,7 +96,6 @@ namespace StardewModdingAPI.Framework.Events /// <summary>Raised after the in-game clock time changes.</summary> public event EventHandler<TimeChangedEventArgs> TimeChanged { - add => this.EventManager.TimeChanged.Add(value, this.Mod); remove => this.EventManager.TimeChanged.Remove(value); } diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs index 8b45e196..b6704f26 100644 --- a/src/SMAPI/Framework/InternalExtensions.cs +++ b/src/SMAPI/Framework/InternalExtensions.cs @@ -164,9 +164,9 @@ namespace StardewModdingAPI.Framework // get field name const string fieldName = #if SMAPI_FOR_WINDOWS - "inBeginEndPair"; + "inBeginEndPair"; #else - "_beginCalled"; + "_beginCalled"; #endif // get result diff --git a/src/SMAPI/Framework/ModHelpers/ModHelper.cs b/src/SMAPI/Framework/ModHelpers/ModHelper.cs index 25401e23..9fbb6072 100644 --- a/src/SMAPI/Framework/ModHelpers/ModHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ModHelper.cs @@ -2,7 +2,6 @@ using System; using System.IO; using StardewModdingAPI.Events; using StardewModdingAPI.Framework.Input; -using StardewModdingAPI.Toolkit.Serialization; namespace StardewModdingAPI.Framework.ModHelpers { diff --git a/src/SMAPI/Framework/RequestExitDelegate.cs b/src/SMAPI/Framework/RequestExitDelegate.cs index 12d0ea0c..810c399b 100644 --- a/src/SMAPI/Framework/RequestExitDelegate.cs +++ b/src/SMAPI/Framework/RequestExitDelegate.cs @@ -4,4 +4,4 @@ namespace StardewModdingAPI.Framework /// <param name="module">The module which requested an immediate exit.</param> /// <param name="reason">The reason provided for the shutdown.</param> internal delegate void RequestExitDelegate(string module, string reason); -}
\ No newline at end of file +} diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 47a23c87..2346550e 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -43,7 +43,7 @@ using StardewModdingAPI.Toolkit.Serialization; using StardewModdingAPI.Toolkit.Utilities; using StardewModdingAPI.Utilities; using StardewValley; -using Object = StardewValley.Object; +using SObject = StardewValley.Object; namespace StardewModdingAPI.Framework { @@ -524,6 +524,7 @@ namespace StardewModdingAPI.Framework Game1.currentLoader = null; this.Monitor.Log("Game loader done."); } + if (SGame.NewDayTask?.Status == TaskStatus.Created) { this.Monitor.Log("New day task synchronizing..."); @@ -605,7 +606,7 @@ namespace StardewModdingAPI.Framework $"{modGroup.Key.DisplayName} (" + string.Join(", ", modGroup.GroupBy(p => p.WasAdded).ToDictionary(p => p.Key, p => p.Count()).Select(p => $"{(p.Key ? "added" : "removed")} {p.Value}")) + ")" - ) + ) ) ); @@ -700,6 +701,7 @@ namespace StardewModdingAPI.Framework this.OnLoadStageChanged(LoadStage.CreatedSaveFile); events.SaveCreated.RaiseEmpty(); } + if (this.IsBetweenSaveEvents) { // raise after-save @@ -731,6 +733,7 @@ namespace StardewModdingAPI.Framework } else context += " Single-player."; + this.Monitor.Log(context); // raise events @@ -1111,7 +1114,7 @@ namespace StardewModdingAPI.Framework // require core fields string[] fields = entry.Value.Split('/'); - if (fields.Length < Object.objectInfoDescriptionIndex + 1) + if (fields.Length < SObject.objectInfoDescriptionIndex + 1) { LogIssue(entry.Key, "too few fields for an object"); hasObjectIssues = true; @@ -1119,10 +1122,10 @@ namespace StardewModdingAPI.Framework } // check min length for specific types - switch (fields[Object.objectInfoTypeIndex].Split(new[] { ' ' }, 2)[0]) + switch (fields[SObject.objectInfoTypeIndex].Split(new[] { ' ' }, 2)[0]) { case "Cooking": - if (fields.Length < Object.objectInfoBuffDurationIndex + 1) + if (fields.Length < SObject.objectInfoBuffDurationIndex + 1) { LogIssue(entry.Key, "too few fields for a cooking item"); hasObjectIssues = true; @@ -1316,6 +1319,7 @@ namespace StardewModdingAPI.Framework } } } + IModMetadata[] loaded = this.ModRegistry.GetAll().ToArray(); IModMetadata[] loadedContentPacks = loaded.Where(p => p.IsContentPack).ToArray(); IModMetadata[] loadedMods = loaded.Where(p => !p.IsContentPack).ToArray(); diff --git a/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs b/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs index f0fb9485..0908b02a 100644 --- a/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs +++ b/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs @@ -58,7 +58,6 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots this.Inventory = watcher.TryGetInventoryChanges(out SnapshotItemListDiff itemChanges) ? itemChanges : this.EmptyItemListDiff; - } } } diff --git a/src/SMAPI/Framework/Utilities/Countdown.cs b/src/SMAPI/Framework/Utilities/Countdown.cs index 921a35ce..342b4258 100644 --- a/src/SMAPI/Framework/Utilities/Countdown.cs +++ b/src/SMAPI/Framework/Utilities/Countdown.cs @@ -34,7 +34,7 @@ this.Current--; return true; } - + /// <summary>Restart the countdown.</summary> public void Reset() { diff --git a/src/SMAPI/IReflectedField.cs b/src/SMAPI/IReflectedField.cs index 43ddad42..7ff61f29 100644 --- a/src/SMAPI/IReflectedField.cs +++ b/src/SMAPI/IReflectedField.cs @@ -23,4 +23,4 @@ namespace StardewModdingAPI //// <param name="value">The value to set.</param> void SetValue(TValue value); } -}
\ No newline at end of file +} diff --git a/src/SMAPI/IReflectedMethod.cs b/src/SMAPI/IReflectedMethod.cs index de83b98c..646e7301 100644 --- a/src/SMAPI/IReflectedMethod.cs +++ b/src/SMAPI/IReflectedMethod.cs @@ -24,4 +24,4 @@ namespace StardewModdingAPI /// <param name="arguments">The method arguments to pass in.</param> void Invoke(params object[] arguments); } -}
\ No newline at end of file +} diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 05251070..23ee8453 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -59,6 +59,7 @@ namespace StardewModdingAPI if (name.Name.Equals(AssemblyName.GetAssemblyName(dll.FullName).Name, StringComparison.OrdinalIgnoreCase)) return Assembly.LoadFrom(dll.FullName); } + return null; } catch (Exception ex) diff --git a/src/SMAPI/Utilities/SDate.cs b/src/SMAPI/Utilities/SDate.cs index 165667a4..cd075dcc 100644 --- a/src/SMAPI/Utilities/SDate.cs +++ b/src/SMAPI/Utilities/SDate.cs @@ -269,7 +269,6 @@ namespace StardewModdingAPI.Utilities this.Year = year; this.DayOfWeek = this.GetDayOfWeek(day); this.DaysSinceStart = this.GetDaysSinceStart(day, season, year); - } /// <summary>Get whether a date represents 0 spring Y1, which is the date during the in-game intro.</summary> |