From aab4ddf05ed825d043330c5d65f7d3503b8b02fb Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 10 Jan 2021 13:12:34 -0500 Subject: fix title screen music not stopping after save is loaded --- src/SMAPI/Framework/SCore.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 3a51b418..f9a36593 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -619,6 +619,7 @@ namespace StardewModdingAPI.Framework if (Game1.currentLoader != null) { this.Monitor.Log("Game loader synchronizing..."); + this.Reflection.GetMethod(Game1.game1, "UpdateTitleScreen").Invoke(Game1.currentGameTime); // run game logic to change music on load, etc while (Game1.currentLoader?.MoveNext() == true) { // raise load stage changed -- cgit From d47d850753ec19d82993c5e2af8a17ca729c43a7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 12 Jan 2021 20:00:40 -0500 Subject: tuck location map reload into method (#751) --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 66 +++++++++++++++++-------------- 1 file changed, 36 insertions(+), 30 deletions(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index b82dedfd..bd1cc50e 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -138,36 +138,7 @@ namespace StardewModdingAPI.Metadata { if (!string.IsNullOrWhiteSpace(location.mapPath.Value) && this.NormalizeAssetNameIgnoringEmpty(location.mapPath.Value) == key) { - // reset patch caches - switch (location) - { - case Town _: - this.Reflection.GetField(location, "ccRefurbished").SetValue(false); - this.Reflection.GetField(location, "isShowingDestroyedJoja").SetValue(false); - this.Reflection.GetField(location, "isShowingUpgradedPamHouse").SetValue(false); - break; - - case Beach _: - case BeachNightMarket _: - case Forest _: - this.Reflection.GetField(location, "hasShownCCUpgrade").SetValue(false); - break; - } - - // general updates - location.reloadMap(); - location.updateSeasonalTileSheets(); - location.updateWarps(); - - // update interior doors - location.interiorDoors.Clear(); - foreach (var entry in new InteriorDoorDictionary(location)) - location.interiorDoors.Add(entry); - - // update doors - location.doors.Clear(); - location.updateDoors(); - + this.ReloadMap(location); anyChanged = true; } } @@ -803,6 +774,41 @@ namespace StardewModdingAPI.Metadata return true; } + /// Reload the map for a location. + /// The location whose map to reload. + private void ReloadMap(GameLocation location) + { + // reset patch caches + switch (location) + { + case Town _: + this.Reflection.GetField(location, "ccRefurbished").SetValue(false); + this.Reflection.GetField(location, "isShowingDestroyedJoja").SetValue(false); + this.Reflection.GetField(location, "isShowingUpgradedPamHouse").SetValue(false); + break; + + case Beach _: + case BeachNightMarket _: + case Forest _: + this.Reflection.GetField(location, "hasShownCCUpgrade").SetValue(false); + break; + } + + // general updates + location.reloadMap(); + location.updateSeasonalTileSheets(); + location.updateWarps(); + + // update interior doors + location.interiorDoors.Clear(); + foreach (var entry in new InteriorDoorDictionary(location)) + location.interiorDoors.Add(entry); + + // update doors + location.doors.Clear(); + location.updateDoors(); + } + /// Reload the disposition data for matching NPCs. /// The content manager through which to reload the asset. /// The asset key to reload. -- cgit From 5db9b049a6156afd580511ed097f0cc705ae41d9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 15 Jan 2021 18:30:59 -0500 Subject: update for draw code changes in SDV 1.5.3 --- src/SMAPI/Constants.cs | 2 +- src/SMAPI/Framework/SGame.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 2c0b85b7..36f8f4b5 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -57,7 +57,7 @@ namespace StardewModdingAPI public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.8.3"); /// The minimum supported version of Stardew Valley. - public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.2"); + public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.3"); /// The maximum supported version of Stardew Valley. public static ISemanticVersion MaximumGameVersion { get; } = null; diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 2ede40ae..42a712ee 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -740,16 +740,20 @@ namespace StardewModdingAPI.Framework Game1.spriteBatch.Draw(Game1.staminaRect, new Microsoft.Xna.Framework.Rectangle(startingX, (int)y, Game1.graphics.GraphicsDevice.Viewport.Width, 1), Microsoft.Xna.Framework.Color.Red * 0.5f); } } + if (Game1.ShouldShowOnscreenUsernames() && Game1.currentLocation != null) + { + Game1.currentLocation.DrawFarmerUsernames(Game1.spriteBatch); + } if (Game1.currentBillboard != 0 && !this.takingMapScreenshot) { this.drawBillboard(); } if (!Game1.eventUp && Game1.farmEvent == null && Game1.currentBillboard == 0 && Game1.gameMode == 3 && !this.takingMapScreenshot && Game1.isOutdoorMapSmallerThanViewport()) { - Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, -Math.Min(Game1.viewport.X, 4096), Game1.graphics.GraphicsDevice.Viewport.Height), Microsoft.Xna.Framework.Color.Black); - Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64, 0, Math.Min(4096, Game1.graphics.GraphicsDevice.Viewport.Width - (-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64)), Game1.graphics.GraphicsDevice.Viewport.Height), Microsoft.Xna.Framework.Color.Black); - Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, Game1.graphics.GraphicsDevice.Viewport.Width, -Math.Min(Game1.viewport.Y, 4096)), Microsoft.Xna.Framework.Color.Black); - Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, -Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64, Game1.graphics.GraphicsDevice.Viewport.Width, Math.Min(4096, Game1.graphics.GraphicsDevice.Viewport.Height - (-Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64))), Microsoft.Xna.Framework.Color.Black); + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, -Math.Min(Game1.viewport.X, GameRunner.MaxTextureSize), Game1.graphics.GraphicsDevice.Viewport.Height), Microsoft.Xna.Framework.Color.Black); + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64, 0, Math.Min(GameRunner.MaxTextureSize, Game1.graphics.GraphicsDevice.Viewport.Width - (-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64)), Game1.graphics.GraphicsDevice.Viewport.Height), Microsoft.Xna.Framework.Color.Black); + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, Game1.graphics.GraphicsDevice.Viewport.Width, -Math.Min(Game1.viewport.Y, GameRunner.MaxTextureSize)), Microsoft.Xna.Framework.Color.Black); + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, -Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64, Game1.graphics.GraphicsDevice.Viewport.Width, Math.Min(GameRunner.MaxTextureSize, Game1.graphics.GraphicsDevice.Viewport.Height - (-Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64))), Microsoft.Xna.Framework.Color.Black); } Game1.spriteBatch.End(); Game1.PushUIMode(); -- cgit From 415047bf8e44057d6aeeffc6191d00817f6b0d1b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 15 Jan 2021 18:33:52 -0500 Subject: prepare for release --- src/SMAPI/Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 36f8f4b5..b72471ca 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -54,7 +54,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.8.3"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.8.4"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.3"); -- cgit