summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ErrorHandler
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler')
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs10
-rw-r--r--src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj16
-rw-r--r--src/SMAPI.Mods.ErrorHandler/manifest.json4
3 files changed, 15 insertions, 15 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs
index 95e4f5ef..8056fd71 100644
--- a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs
+++ b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs
@@ -27,11 +27,9 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
#endif
{
harmony.Patch(
-#if SMAPI_FOR_WINDOWS
- original: AccessTools.Method(typeof(SpriteBatch), "InternalDraw"),
-#else
- original: AccessTools.Method(typeof(SpriteBatch), "CheckValid", new[] { typeof(Texture2D) }),
-#endif
+ original: Constants.GameFramework == GameFramework.Xna
+ ? AccessTools.Method(typeof(SpriteBatch), "InternalDraw")
+ : AccessTools.Method(typeof(SpriteBatch), "CheckValid", new[] { typeof(Texture2D) }),
postfix: new HarmonyMethod(this.GetType(), nameof(SpriteBatchValidationPatches.After_SpriteBatch_CheckValid))
);
}
@@ -40,7 +38,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
/*********
** Private methods
*********/
-#if SMAPI_FOR_WINDOWS
+#if SMAPI_FOR_XNA
/// <summary>The method to call instead of <see cref="SpriteBatch.InternalDraw"/>.</summary>
/// <param name="texture">The texture to validate.</param>
#else
diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj
index 5c0cf952..788f6f16 100644
--- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj
+++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj
@@ -4,9 +4,10 @@
<RootNamespace>StardewModdingAPI.Mods.ErrorHandler</RootNamespace>
<TargetFramework>net45</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
- <PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
+ <Import Project="..\..\build\common.targets" />
+
<ItemGroup>
<ProjectReference Include="..\SMAPI\SMAPI.csproj" Private="False" />
<Reference Include="..\..\build\0Harmony.dll" Private="False" />
@@ -16,19 +17,21 @@
<Reference Include="$(GameExecutableName)" HintPath="$(GamePath)\$(GameExecutableName).exe" Private="False" />
</ItemGroup>
+ <!-- Windows only -->
+ <ItemGroup Condition="'$(OS)' == 'Windows_NT'">
+ <Reference Include="Netcode" HintPath="$(GamePath)\Netcode.dll" Private="False" />
+ </ItemGroup>
+
+ <!-- Game framework -->
<Choose>
- <!-- Windows -->
- <When Condition="$(OS) == 'Windows_NT'">
+ <When Condition="$(DefineConstants.Contains(SMAPI_FOR_XNA))">
<ItemGroup>
- <Reference Include="Netcode" HintPath="$(GamePath)\Netcode.dll" Private="False" />
<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>
-
- <!-- Linux/Mac -->
<Otherwise>
<ItemGroup>
<Reference Include="MonoGame.Framework" HintPath="$(GamePath)\MonoGame.Framework.dll" Private="False" />
@@ -42,5 +45,4 @@
</ItemGroup>
<Import Project="..\SMAPI.Internal\SMAPI.Internal.projitems" Label="Shared" />
- <Import Project="..\..\build\common.targets" />
</Project>
diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json
index 52bf4f6a..1e810113 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.9.4",
+ "Version": "3.9.5",
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
"UniqueID": "SMAPI.ErrorHandler",
"EntryDll": "ErrorHandler.dll",
- "MinimumApiVersion": "3.9.4"
+ "MinimumApiVersion": "3.9.5"
}