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">
<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>

View File

@ -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).

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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>
}

View File

@ -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>

View File

@ -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,15 +157,14 @@ 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 = startRow * sourceArea.Width; i < pixelCount; i++)
for (int i = firstPixel; i <= lastPixel; i++)
{
if (sourceData[i].A >= AssetDataForImage.MinOpacity)
{
@ -174,7 +175,7 @@ namespace StardewModdingAPI.Framework.Content
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)
{
@ -184,7 +185,6 @@ namespace StardewModdingAPI.Framework.Content
}
if (endIndex == -1)
return; // ???
}
// update target rectangle
int sourceOffset;