summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/StardewModdingAPI/Program.cs4
-rw-r--r--src/StardewModdingAPI/StardewModdingAPI.csproj8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index f6c63851..b8a8b856 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -5,7 +5,9 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
+#if SMAPI_FOR_WINDOWS
using System.Windows.Forms;
+#endif
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI.Events;
@@ -208,8 +210,10 @@ namespace StardewModdingAPI
public static void RunGame()
{
+#if SMAPI_FOR_WINDOWS
Application.ThreadException += Log.Application_ThreadException;
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+#endif
AppDomain.CurrentDomain.UnhandledException += Log.CurrentDomain_UnhandledException;
try
diff --git a/src/StardewModdingAPI/StardewModdingAPI.csproj b/src/StardewModdingAPI/StardewModdingAPI.csproj
index b2fbfb31..4294c561 100644
--- a/src/StardewModdingAPI/StardewModdingAPI.csproj
+++ b/src/StardewModdingAPI/StardewModdingAPI.csproj
@@ -92,6 +92,9 @@
</PropertyGroup>
<Choose>
<When Condition="$(OS) == 'Windows_NT'">
+ <PropertyGroup>
+ <DefineConstants>$(DefineConstants);SMAPI_FOR_WINDOWS</DefineConstants>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
@@ -117,6 +120,9 @@
</ItemGroup>
</When>
<Otherwise>
+ <PropertyGroup>
+ <DefineConstants>$(DefineConstants);SMAPI_FOR_UNIX</DefineConstants>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
@@ -142,7 +148,7 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Windows.Forms" Condition="$(OS) == 'Windows_NT'" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />