Merge branch 'develop' into stable

This commit is contained in:
Jesse Plamondon-Willard 2022-12-01 20:24:22 -05:00
commit 368b25b541
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
8 changed files with 39 additions and 30 deletions

View File

@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<!--set general build properties --> <!--set general build properties -->
<Version>3.18.0</Version> <Version>3.18.1</Version>
<Product>SMAPI</Product> <Product>SMAPI</Product>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths> <AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>

View File

@ -7,6 +7,15 @@
_If needed, you can update to SMAPI 3.16.0 first and then install the latest version._ _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 ## 3.18.0
Released 12 November 2022 for Stardew Valley 1.5.6 or later. See [release highlights](https://www.patreon.com/posts/74565278). Released 12 November 2022 for Stardew Valley 1.5.6 or later. See [release highlights](https://www.patreon.com/posts/74565278).

View File

@ -1,9 +1,9 @@
{ {
"Name": "Console Commands", "Name": "Console Commands",
"Author": "SMAPI", "Author": "SMAPI",
"Version": "3.18.0", "Version": "3.18.1",
"Description": "Adds SMAPI console commands that let you manipulate the game.", "Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands", "UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll", "EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "3.18.0" "MinimumApiVersion": "3.18.1"
} }

View File

@ -1,9 +1,9 @@
{ {
"Name": "Error Handler", "Name": "Error Handler",
"Author": "SMAPI", "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.", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
"UniqueID": "SMAPI.ErrorHandler", "UniqueID": "SMAPI.ErrorHandler",
"EntryDll": "ErrorHandler.dll", "EntryDll": "ErrorHandler.dll",
"MinimumApiVersion": "3.18.0" "MinimumApiVersion": "3.18.1"
} }

View File

@ -1,9 +1,9 @@
{ {
"Name": "Save Backup", "Name": "Save Backup",
"Author": "SMAPI", "Author": "SMAPI",
"Version": "3.18.0", "Version": "3.18.1",
"Description": "Automatically backs up all your saves once per day into its folder.", "Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup", "UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll", "EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "3.18.0" "MinimumApiVersion": "3.18.1"
} }

View File

@ -248,7 +248,7 @@ else if (log?.IsValid == true)
{ {
<h2>Suggested fixes</h2> <h2>Suggested fixes</h2>
<ul id="fix-list"> <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> <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>
} }

View File

@ -52,7 +52,7 @@ namespace StardewModdingAPI
internal static int? LogScreenId { get; set; } internal static int? LogScreenId { get; set; }
/// <summary>SMAPI's current raw semantic version.</summary> /// <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> /// <summary>Contains SMAPI's constants and assumptions.</summary>

View File

@ -140,9 +140,11 @@ namespace StardewModdingAPI.Framework.Content
/// <exception cref="InvalidOperationException">The content being read isn't an image.</exception> /// <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) 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; Texture2D target = this.Data;
int pixelCount = sourceArea.Width * sourceArea.Height; int pixelCount = sourceArea.Width * sourceArea.Height;
int firstPixel = startRow * sourceArea.Width;
int lastPixel = firstPixel + pixelCount - 1;
// validate // validate
if (sourceArea.X < 0 || sourceArea.Y < 0 || sourceArea.Right > sourceWidth || sourceArea.Bottom > sourceHeight) if (sourceArea.X < 0 || sourceArea.Y < 0 || sourceArea.Right > sourceWidth || sourceArea.Bottom > sourceHeight)
@ -155,15 +157,14 @@ namespace StardewModdingAPI.Framework.Content
// shortcut: replace the entire area // shortcut: replace the entire area
if (patchMode == PatchMode.Replace) if (patchMode == PatchMode.Replace)
{ {
target.SetData(0, targetArea, sourceData, startRow * sourceArea.Width, pixelCount); target.SetData(0, targetArea, sourceData, firstPixel, pixelCount);
return; return;
} }
// skip transparent pixels at the start & end (e.g. large spritesheet with a few sprites replaced) // skip transparent pixels at the start & end (e.g. large spritesheet with a few sprites replaced)
int startIndex = -1; int startIndex = -1;
int endIndex = -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)
{ {
@ -174,7 +175,7 @@ namespace StardewModdingAPI.Framework.Content
if (startIndex == -1) if (startIndex == -1)
return; // blank texture 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)
{ {
@ -184,7 +185,6 @@ namespace StardewModdingAPI.Framework.Content
} }
if (endIndex == -1) if (endIndex == -1)
return; // ??? return; // ???
}
// update target rectangle // update target rectangle
int sourceOffset; int sourceOffset;