diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-11-30 17:14:03 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-11-30 17:14:03 -0500 |
commit | 3342502993c39efec6734c68e4800d29073eeeec (patch) | |
tree | a96f1b62b3aeba3d5b12ad7496de06a94d39c977 /src/SMAPI.Mods.ErrorHandler | |
parent | d578345cfd53df8a91ae8e0e1346b711332a999a (diff) | |
parent | b294ac1203aa78575f8c72f0be1ee9d3edff15ab (diff) | |
download | SMAPI-3342502993c39efec6734c68e4800d29073eeeec.tar.gz SMAPI-3342502993c39efec6734c68e4800d29073eeeec.tar.bz2 SMAPI-3342502993c39efec6734c68e4800d29073eeeec.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler')
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchPatcher.cs | 9 | ||||
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj | 27 | ||||
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/manifest.json | 4 |
3 files changed, 6 insertions, 34 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchPatcher.cs b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchPatcher.cs index 6860a4ec..f243c6d1 100644 --- a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchPatcher.cs +++ b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchPatcher.cs @@ -19,9 +19,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches public override void Apply(Harmony harmony, IMonitor monitor) { harmony.Patch( - original: Constants.GameFramework == GameFramework.Xna - ? this.RequireMethod<SpriteBatch>("InternalDraw") - : this.RequireMethod<SpriteBatch>("CheckValid", new[] { typeof(Texture2D) }), + original: this.RequireMethod<SpriteBatch>("CheckValid", new[] { typeof(Texture2D) }), postfix: this.GetHarmonyMethod(nameof(SpriteBatchPatcher.After_CheckValid)) ); } @@ -30,13 +28,8 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches /********* ** Private methods *********/ -#if SMAPI_FOR_XNA - /// <summary>The method to call after <see cref="SpriteBatch.InternalDraw"/>.</summary> - /// <param name="texture">The texture to validate.</param> -#else /// <summary>The method to call after <see cref="SpriteBatch.CheckValid"/>.</summary> /// <param name="texture">The texture to validate.</param> -#endif private static void After_CheckValid(Texture2D texture) { if (texture?.IsDisposed == true) diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj index 182a978e..78cdb315 100644 --- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj +++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <AssemblyName>ErrorHandler</AssemblyName> <RootNamespace>StardewModdingAPI.Mods.ErrorHandler</RootNamespace> - <TargetFramework>net452</TargetFramework> + <TargetFramework>net5.0</TargetFramework> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> </PropertyGroup> @@ -14,33 +14,12 @@ </ItemGroup> <ItemGroup> - <Reference Include="$(GameExecutableName)" HintPath="$(GamePath)\$(GameExecutableName).exe" Private="False" /> + <Reference Include="MonoGame.Framework" HintPath="$(GamePath)\MonoGame.Framework.dll" Private="False" /> + <Reference Include="Stardew Valley" HintPath="$(GamePath)\Stardew Valley.dll" Private="False" /> <Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="False" /> <Reference Include="xTile" HintPath="$(GamePath)\xTile.dll" Private="False" /> </ItemGroup> - <!-- Windows only --> - <ItemGroup Condition="'$(OS)' == 'Windows_NT'"> - <Reference Include="Netcode" HintPath="$(GamePath)\Netcode.dll" Private="False" /> - </ItemGroup> - - <!-- Game framework --> - <Choose> - <When Condition="$(DefineConstants.Contains(SMAPI_FOR_XNA))"> - <ItemGroup> - <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="False" /> - <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="False" /> - <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="False" /> - <Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" Private="False" /> - </ItemGroup> - </When> - <Otherwise> - <ItemGroup> - <Reference Include="MonoGame.Framework" HintPath="$(GamePath)\MonoGame.Framework.dll" Private="False" /> - </ItemGroup> - </Otherwise> - </Choose> - <ItemGroup> <None Update="i18n\*.json" CopyToOutputDirectory="PreserveNewest" /> <None Update="manifest.json" CopyToOutputDirectory="PreserveNewest" /> diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index cfbaa661..da8306d1 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.12.8", + "Version": "3.13.0", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.12.8" + "MinimumApiVersion": "3.13.0" } |