summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-12 21:26:09 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-11-28 00:01:41 -0500
commit40b74398ace748a565199fb91325815804011a98 (patch)
tree12490faacc5eb39adc758c3dd06c8435869c5734 /src/SMAPI
parent2b922a71a2a4f85712ab1e84b85c9229185a131a (diff)
downloadSMAPI-40b74398ace748a565199fb91325815804011a98.tar.gz
SMAPI-40b74398ace748a565199fb91325815804011a98.tar.bz2
SMAPI-40b74398ace748a565199fb91325815804011a98.zip
update for game assembly name now consistent on all platforms
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Constants.cs12
-rw-r--r--src/SMAPI/Program.cs2
2 files changed, 4 insertions, 10 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs
index 776b3e3c..2c16052b 100644
--- a/src/SMAPI/Constants.cs
+++ b/src/SMAPI/Constants.cs
@@ -43,7 +43,7 @@ namespace StardewModdingAPI
internal static GameFramework GameFramework { get; } = GameFramework.MonoGame;
/// <summary>The game's assembly name.</summary>
- internal static string GameAssemblyName => EarlyConstants.Platform == GamePlatform.Windows ? "Stardew Valley" : "StardewValley";
+ internal static string GameAssemblyName { get; } = "Stardew Valley";
/// <summary>The <see cref="Context.ScreenId"/> value which should appear in the SMAPI log, if any.</summary>
internal static int? LogScreenId { get; set; }
@@ -269,14 +269,8 @@ namespace StardewModdingAPI
);
// Stardew Valley reference
- removeAssemblyReferences.Add(
- Constants.Platform == Platform.Windows
- ? "StardewValley"
- : "Stardew Valley"
- );
- targetAssemblies.Add(
- typeof(StardewValley.Game1).Assembly
- );
+ removeAssemblyReferences.Add("StardewValley");
+ targetAssemblies.Add(typeof(StardewValley.Game1).Assembly);
return new PlatformAssemblyMap(targetPlatform, removeAssemblyReferences.ToArray(), targetAssemblies.ToArray());
}
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index 574e781d..3e2213ba 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -35,7 +35,7 @@ namespace StardewModdingAPI
Program.AssertSmapiVersions();
Program.Start(args);
}
- catch (BadImageFormatException ex) when (ex.FileName == "StardewValley" || ex.FileName == "Stardew Valley") // don't use EarlyConstants.GameAssemblyName, since we want to check both possible names
+ catch (BadImageFormatException ex) when (ex.FileName == EarlyConstants.GameAssemblyName)
{
Console.WriteLine($"SMAPI failed to initialize because your game's {ex.FileName}.exe seems to be invalid.\nThis may be a pirated version which modified the executable in an incompatible way; if so, you can try a different download or buy a legitimate version.\n\nTechnical details:\n{ex}");
}