Skip to content

Commit

Permalink
Fix windows-only code warnings in ReleaseGameRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Apr 19, 2022
1 parent 7ca095a commit 55b90c2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion EndlessClient/GameExecution/ReleaseGameRunner.cs
@@ -1,4 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
#if !LINUX
using System.Windows.Forms;
#endif
Expand Down Expand Up @@ -28,6 +30,8 @@ public override bool SetupDependencies()
"Dependency setup error!",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
#else
throw;
#endif
return false;
}
Expand All @@ -42,12 +46,18 @@ public override void RunGame()
catch (Exception ex)
{
#if !LINUX
ShowExceptionDialog(ex);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
ShowExceptionDialog(ex);
else
throw;
#else
throw;
#endif
}
}

#if !LINUX
[SupportedOSPlatform("Windows")]
private static void ShowExceptionDialog(Exception ex)
{
Application.EnableVisualStyles();
Expand Down

0 comments on commit 55b90c2

Please sign in to comment.