diff --git a/build/GlobalAssemblyInfo.cs b/build/GlobalAssemblyInfo.cs index 298204dc..da80f48b 100644 --- a/build/GlobalAssemblyInfo.cs +++ b/build/GlobalAssemblyInfo.cs @@ -1,5 +1,5 @@ using System.Reflection; [assembly: AssemblyProduct("SMAPI")] -[assembly: AssemblyVersion("2.10.0")] -[assembly: AssemblyFileVersion("2.10.0")] +[assembly: AssemblyVersion("2.10.1")] +[assembly: AssemblyFileVersion("2.10.1")] diff --git a/docs/release-notes.md b/docs/release-notes.md index 2fd4b42c..e08e7af4 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,4 +1,10 @@ # Release notes +## 2.10.1 +Released 30 December 2018 for Stardew Valley 1.3.32. + +* For players: + * Fixed some mod integrations not working correctly in SMAPI 2.10. + ## 2.10 Released 29 December 2018 for Stardew Valley 1.3.32. diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 3e7001d5..0341c390 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "2.10.0", + "Version": "2.10.1", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "2.10.0" + "MinimumApiVersion": "2.10.1" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 0e2601ad..b2b9ad4b 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "2.10.0", + "Version": "2.10.1", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "2.10.0" + "MinimumApiVersion": "2.10.1" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 9ceaf11d..a0ba67ab 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -29,7 +29,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("2.10.0"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("2.10.1"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.3.32"); diff --git a/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs b/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs index dadbb71a..48e08e5e 100644 --- a/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs +++ b/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs @@ -1,5 +1,5 @@ using System; -using StardewValley; +using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { @@ -10,7 +10,7 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The number of ticks elapsed since the game started, including the current tick. - public uint Ticks => (uint)Game1.ticks; + public uint Ticks => SGame.TicksElapsed; /********* diff --git a/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs b/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs index e9bb46c6..58cf802a 100644 --- a/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs +++ b/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs @@ -1,5 +1,5 @@ using System; -using StardewValley; +using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { @@ -9,8 +9,8 @@ namespace StardewModdingAPI.Events /********* ** Accessors *********/ - /// The number of ticks elapsed since the game started, including the current tick. - public uint Ticks => (uint)Game1.ticks; + /// The number of ticks elapsed since the game started, excluding the upcoming tick. + public uint Ticks => SGame.TicksElapsed; /********* diff --git a/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs b/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs index d15e9531..13c367a0 100644 --- a/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs +++ b/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs @@ -1,5 +1,5 @@ using System; -using StardewValley; +using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { @@ -10,10 +10,10 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The number of ticks elapsed since the game started, including the current tick. - public uint Ticks => (uint)Game1.ticks; + public uint Ticks => SGame.TicksElapsed; /// Whether is a multiple of 60, which happens approximately once per second. - public bool IsOneSecond => Game1.ticks % 60 == 0; + public bool IsOneSecond => this.Ticks % 60 == 0; /********* diff --git a/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs b/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs index 577f0776..c2e60f25 100644 --- a/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs +++ b/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs @@ -1,5 +1,5 @@ using System; -using StardewValley; +using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { @@ -9,11 +9,11 @@ namespace StardewModdingAPI.Events /********* ** Accessors *********/ - /// The number of ticks elapsed since the game started, including the current tick. - public uint Ticks => (uint)Game1.ticks; + /// The number of ticks elapsed since the game started, excluding the upcoming tick. + public uint Ticks => SGame.TicksElapsed; /// Whether is a multiple of 60, which happens approximately once per second. - public bool IsOneSecond => Game1.ticks % 60 == 0; + public bool IsOneSecond => this.Ticks % 60 == 0; /********* diff --git a/src/SMAPI/Events/UpdateTickedEventArgs.cs b/src/SMAPI/Events/UpdateTickedEventArgs.cs index aa710b44..4f3329ac 100644 --- a/src/SMAPI/Events/UpdateTickedEventArgs.cs +++ b/src/SMAPI/Events/UpdateTickedEventArgs.cs @@ -1,5 +1,5 @@ using System; -using StardewValley; +using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { @@ -10,10 +10,10 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The number of ticks elapsed since the game started, including the current tick. - public uint Ticks => (uint)Game1.ticks; + public uint Ticks => SGame.TicksElapsed; /// Whether is a multiple of 60, which happens approximately once per second. - public bool IsOneSecond => Game1.ticks % 60 == 0; + public bool IsOneSecond => this.Ticks % 60 == 0; /********* diff --git a/src/SMAPI/Events/UpdateTickingEventArgs.cs b/src/SMAPI/Events/UpdateTickingEventArgs.cs index cacf5a54..0d3187cd 100644 --- a/src/SMAPI/Events/UpdateTickingEventArgs.cs +++ b/src/SMAPI/Events/UpdateTickingEventArgs.cs @@ -1,5 +1,5 @@ using System; -using StardewValley; +using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { @@ -9,11 +9,11 @@ namespace StardewModdingAPI.Events /********* ** Accessors *********/ - /// The number of ticks elapsed since the game started, including the current tick. - public uint Ticks => (uint)Game1.ticks; + /// The number of ticks elapsed since the game started, excluding the upcoming tick. + public uint Ticks => SGame.TicksElapsed; /// Whether is a multiple of 60, which happens approximately once per second. - public bool IsOneSecond => Game1.ticks % 60 == 0; + public bool IsOneSecond => this.Ticks % 60 == 0; /********* diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index e2835a70..25ffcabd 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -109,6 +109,9 @@ namespace StardewModdingAPI.Framework /// Static state to use while is initialising, which happens before the constructor runs. internal static SGameConstructorHack ConstructorHack { get; set; } + /// The number of update ticks which have already executed. This is similar to , but incremented more consistently for every tick. + internal static uint TicksElapsed { get; private set; } + /// SMAPI's content manager. public ContentCoordinator ContentCore { get; private set; } @@ -339,6 +342,7 @@ namespace StardewModdingAPI.Framework if (Game1._newDayTask != null || Game1.gameMode == Game1.loadingMode) { events.UnvalidatedUpdateTicking.RaiseEmpty(); + SGame.TicksElapsed++; base.Update(gameTime); events.UnvalidatedUpdateTicked.RaiseEmpty(); #if !SMAPI_3_0_STRICT @@ -431,6 +435,7 @@ namespace StardewModdingAPI.Framework // suppress non-save events events.UnvalidatedUpdateTicking.RaiseEmpty(); + SGame.TicksElapsed++; base.Update(gameTime); events.UnvalidatedUpdateTicked.RaiseEmpty(); #if !SMAPI_3_0_STRICT @@ -874,7 +879,7 @@ namespace StardewModdingAPI.Framework ** Game update *********/ // game launched - bool isFirstTick = Game1.ticks == 0; + bool isFirstTick = SGame.TicksElapsed == 0; if (isFirstTick) events.GameLaunched.Raise(new GameLaunchedEventArgs()); @@ -883,7 +888,7 @@ namespace StardewModdingAPI.Framework this.OnLoadStageChanged(LoadStage.Loaded); // update tick - bool isOneSecond = Game1.ticks % 60 == 0; + bool isOneSecond = SGame.TicksElapsed % 60 == 0; events.UnvalidatedUpdateTicking.RaiseEmpty(); events.UpdateTicking.RaiseEmpty(); if (isOneSecond) @@ -891,6 +896,7 @@ namespace StardewModdingAPI.Framework try { this.Input.UpdateSuppression(); + SGame.TicksElapsed++; base.Update(gameTime); } catch (Exception ex) @@ -910,17 +916,17 @@ namespace StardewModdingAPI.Framework if (isFirstTick) events.Legacy_FirstUpdateTick.Raise(); events.Legacy_UpdateTick.Raise(); - if (Game1.ticks % 2 == 0) + if (SGame.TicksElapsed % 2 == 0) events.Legacy_SecondUpdateTick.Raise(); - if (Game1.ticks % 4 == 0) + if (SGame.TicksElapsed % 4 == 0) events.Legacy_FourthUpdateTick.Raise(); - if (Game1.ticks % 8 == 0) + if (SGame.TicksElapsed % 8 == 0) events.Legacy_EighthUpdateTick.Raise(); - if (Game1.ticks % 15 == 0) + if (SGame.TicksElapsed % 15 == 0) events.Legacy_QuarterSecondTick.Raise(); - if (Game1.ticks % 30 == 0) + if (SGame.TicksElapsed % 30 == 0) events.Legacy_HalfSecondTick.Raise(); - if (Game1.ticks % 60 == 0) + if (SGame.TicksElapsed % 60 == 0) events.Legacy_OneSecondTick.Raise(); #endif @@ -1384,7 +1390,7 @@ namespace StardewModdingAPI.Framework } Game1.drawPlayerHeldObject(Game1.player); } - label_129: + label_129: if ((Game1.player.UsingTool || Game1.pickingTool) && Game1.player.CurrentTool != null && ((!Game1.player.CurrentTool.Name.Equals("Seeds") || Game1.pickingTool) && (Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.getStandingX(), (int)Game1.player.Position.Y - 38), Game1.viewport.Size) != null && Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.getStandingX(), Game1.player.getStandingY()), Game1.viewport.Size) == null))) Game1.drawTool(Game1.player); if (Game1.currentLocation.Map.GetLayer("AlwaysFront") != null)