diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-12-01 20:24:22 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-12-01 20:24:22 -0500 |
commit | 368b25b5411683192f4398616abed61441457799 (patch) | |
tree | 6e2819b221d9519f2f35ed463ad0c54a14eea058 | |
parent | b95d2a3f935dde0118205f94b32f05f115afdf71 (diff) | |
parent | a2944eed5c635ecf9afaefe9cf377f049a40731f (diff) | |
download | SMAPI-368b25b5411683192f4398616abed61441457799.tar.gz SMAPI-368b25b5411683192f4398616abed61441457799.tar.bz2 SMAPI-368b25b5411683192f4398616abed61441457799.zip |
Merge branch 'develop' into stable
-rw-r--r-- | build/common.targets | 2 | ||||
-rw-r--r-- | docs/release-notes.md | 9 | ||||
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 | ||||
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/manifest.json | 4 | ||||
-rw-r--r-- | src/SMAPI.Mods.SaveBackup/manifest.json | 4 | ||||
-rw-r--r-- | src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 | ||||
-rw-r--r-- | src/SMAPI/Constants.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Framework/Content/AssetDataForImage.cs | 36 |
8 files changed, 36 insertions, 27 deletions
diff --git a/build/common.targets b/build/common.targets index 4b92ecc2..512107a0 100644 --- a/build/common.targets +++ b/build/common.targets @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <!--set general build properties --> - <Version>3.18.0</Version> + <Version>3.18.1</Version> <Product>SMAPI</Product> <LangVersion>latest</LangVersion> <AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths> diff --git a/docs/release-notes.md b/docs/release-notes.md index 9b2dea77..ae98a0c4 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,15 @@ _If needed, you can update to SMAPI 3.16.0 first and then install the latest version._ --> +## 3.18.1 +Released 01 December 2022 for Stardew Valley 1.5.6 or later. + +* For players: + * Fixed mod texture edits sometimes cut off (thanks to atravita!). + +* For the web UI: + * The log parser no longer warns about missing Error Handler on Android, where it doesn't exist yet (thanks to AnotherPillow!). + ## 3.18.0 Released 12 November 2022 for Stardew Valley 1.5.6 or later. See [release highlights](https://www.patreon.com/posts/74565278). diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index ddb0e20d..0afb5837 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": "3.18.0", + "Version": "3.18.1", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.18.0" + "MinimumApiVersion": "3.18.1" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index eeea1d28..fe802d88 100644 --- a/src/SMAPI.Mods.ErrorHandler/manifest.json +++ b/src/SMAPI.Mods.ErrorHandler/manifest.json @@ -1,9 +1,9 @@ { "Name": "Error Handler", "Author": "SMAPI", - "Version": "3.18.0", + "Version": "3.18.1", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.18.0" + "MinimumApiVersion": "3.18.1" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 0acf066d..9a587a2b 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": "3.18.0", + "Version": "3.18.1", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.18.0" + "MinimumApiVersion": "3.18.1" } diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index c1251c21..b989417e 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -248,7 +248,7 @@ else if (log?.IsValid == true) { <h2>Suggested fixes</h2> <ul id="fix-list"> - @if (errorHandler is null) + @if (errorHandler is null && log.ApiVersionParsed?.IsNewerThan("3.8.4") is true) { <li class="important">You don't have the <strong>Error Handler</strong> mod installed. This automatically prevents many game or mod errors. You can <a href="https://stardewvalleywiki.com/Modding:Player_Guide#Install_SMAPI">reinstall SMAPI</a> to re-add it.</li> } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 02e75e05..c5058e4b 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -52,7 +52,7 @@ namespace StardewModdingAPI internal static int? LogScreenId { get; set; } /// <summary>SMAPI's current raw semantic version.</summary> - internal static string RawApiVersion = "3.18.0"; + internal static string RawApiVersion = "3.18.1"; } /// <summary>Contains SMAPI's constants and assumptions.</summary> diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs index 7c8cc6a8..89ced1ba 100644 --- a/src/SMAPI/Framework/Content/AssetDataForImage.cs +++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs @@ -140,9 +140,11 @@ namespace StardewModdingAPI.Framework.Content /// <exception cref="InvalidOperationException">The content being read isn't an image.</exception> private void PatchImageImpl(Color[] sourceData, int sourceWidth, int sourceHeight, Rectangle sourceArea, Rectangle targetArea, PatchMode patchMode, int startRow = 0) { - // get texture + // get texture info Texture2D target = this.Data; int pixelCount = sourceArea.Width * sourceArea.Height; + int firstPixel = startRow * sourceArea.Width; + int lastPixel = firstPixel + pixelCount - 1; // validate if (sourceArea.X < 0 || sourceArea.Y < 0 || sourceArea.Right > sourceWidth || sourceArea.Bottom > sourceHeight) @@ -155,36 +157,34 @@ namespace StardewModdingAPI.Framework.Content // shortcut: replace the entire area if (patchMode == PatchMode.Replace) { - target.SetData(0, targetArea, sourceData, startRow * sourceArea.Width, pixelCount); + target.SetData(0, targetArea, sourceData, firstPixel, pixelCount); return; } // skip transparent pixels at the start & end (e.g. large spritesheet with a few sprites replaced) int startIndex = -1; int endIndex = -1; + for (int i = firstPixel; i <= lastPixel; i++) { - for (int i = startRow * sourceArea.Width; i < pixelCount; i++) + if (sourceData[i].A >= AssetDataForImage.MinOpacity) { - if (sourceData[i].A >= AssetDataForImage.MinOpacity) - { - startIndex = i; - break; - } + startIndex = i; + break; } - if (startIndex == -1) - return; // blank texture + } + if (startIndex == -1) + return; // blank texture - for (int i = startRow * sourceArea.Width + pixelCount - 1; i >= startIndex; i--) + for (int i = lastPixel; i >= startIndex; i--) + { + if (sourceData[i].A >= AssetDataForImage.MinOpacity) { - if (sourceData[i].A >= AssetDataForImage.MinOpacity) - { - endIndex = i; - break; - } + endIndex = i; + break; } - if (endIndex == -1) - return; // ??? } + if (endIndex == -1) + return; // ??? // update target rectangle int sourceOffset; |