Merge branch 'develop' into stable
This commit is contained in:
commit
368b25b541
|
@ -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>
|
||||
|
|
|
@ -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).
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
||||
for (int i = startRow * sourceArea.Width + pixelCount - 1; i >= startIndex; i--)
|
||||
{
|
||||
if (sourceData[i].A >= AssetDataForImage.MinOpacity)
|
||||
{
|
||||
endIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (endIndex == -1)
|
||||
return; // ???
|
||||
}
|
||||
if (startIndex == -1)
|
||||
return; // blank texture
|
||||
|
||||
for (int i = lastPixel; i >= startIndex; i--)
|
||||
{
|
||||
if (sourceData[i].A >= AssetDataForImage.MinOpacity)
|
||||
{
|
||||
endIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (endIndex == -1)
|
||||
return; // ???
|
||||
|
||||
// update target rectangle
|
||||
int sourceOffset;
|
||||
|
|
Loading…
Reference in New Issue