From b3b1b143baf99673f42b65ef7d84e4135bfc6d48 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 30 Dec 2018 16:56:35 -0500 Subject: fix GameLaunched raised twice due to Game1.ticks not incrementing reliably --- src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs | 4 ++-- src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs | 6 +++--- src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs | 6 +++--- src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs | 8 ++++---- src/SMAPI/Events/UpdateTickedEventArgs.cs | 6 +++--- src/SMAPI/Events/UpdateTickingEventArgs.cs | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/SMAPI/Events') 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; /********* -- cgit