diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-23 21:35:07 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-23 21:35:07 -0400 |
commit | 8bcc80a33d42f5c6f044533bb151d75901de912f (patch) | |
tree | 84918fd9a98c327cb79dce200f2308401ddae709 /src/StardewModdingAPI | |
parent | 2d36105c33ffba77eb979ef6ef0d2e7d906b09bc (diff) | |
download | SMAPI-8bcc80a33d42f5c6f044533bb151d75901de912f.tar.gz SMAPI-8bcc80a33d42f5c6f044533bb151d75901de912f.tar.bz2 SMAPI-8bcc80a33d42f5c6f044533bb151d75901de912f.zip |
rename mod compatibility type for broader use (#361)
Diffstat (limited to 'src/StardewModdingAPI')
-rw-r--r-- | src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/Framework/Models/ModCompatibility.cs | 6 | ||||
-rw-r--r-- | src/StardewModdingAPI/Framework/Models/ModStatus.cs (renamed from src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs) | 7 | ||||
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/StardewModdingAPI.csproj | 2 |
5 files changed, 11 insertions, 8 deletions
diff --git a/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs b/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs index 87b6a99c..6a971c15 100644 --- a/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs +++ b/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs @@ -107,7 +107,7 @@ namespace StardewModdingAPI.Framework.ModLoading // validate compatibility { ModCompatibility compatibility = mod.Compatibility; - if (compatibility?.Compatibility == ModCompatibilityType.AssumeBroken) + if (compatibility?.Status == ModStatus.AssumeBroken) { string reasonPhrase = compatibility.ReasonPhrase ?? "it's no longer compatible"; string error = $"{reasonPhrase}. Please check for a "; diff --git a/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs b/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs index d3a9c533..7489a306 100644 --- a/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs +++ b/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using StardewModdingAPI.Framework.Serialisation; namespace StardewModdingAPI.Framework.Models @@ -34,7 +34,7 @@ namespace StardewModdingAPI.Framework.Models /// <example>"this version is incompatible with the latest version of the game"</example> public string ReasonPhrase { get; set; } - /// <summary>Indicates how SMAPI should consider the mod.</summary> - public ModCompatibilityType Compatibility { get; set; } = ModCompatibilityType.AssumeBroken; + /// <summary>Indicates how SMAPI should treat the mod.</summary> + public ModStatus Status { get; set; } = ModStatus.AssumeBroken; } } diff --git a/src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs b/src/StardewModdingAPI/Framework/Models/ModStatus.cs index 35edec5e..4ab0b790 100644 --- a/src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs +++ b/src/StardewModdingAPI/Framework/Models/ModStatus.cs @@ -1,8 +1,11 @@ namespace StardewModdingAPI.Framework.Models { - /// <summary>Indicates how SMAPI should consider a mod.</summary> - internal enum ModCompatibilityType + /// <summary>Indicates how SMAPI should treat a mod.</summary> + internal enum ModStatus { + /// <summary>Don't override the status.</summary> + None = 0, + /// <summary>Assume the mod is not compatible, even if SMAPI doesn't detect any incompatible code.</summary> AssumeBroken = 0, diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 8f32b9eb..234572a6 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -640,7 +640,7 @@ namespace StardewModdingAPI Assembly modAssembly; try { - modAssembly = modAssemblyLoader.Load(metadata, assemblyPath, assumeCompatible: metadata.Compatibility?.Compatibility == ModCompatibilityType.AssumeCompatible); + modAssembly = modAssemblyLoader.Load(metadata, assemblyPath, assumeCompatible: metadata.Compatibility?.Status == ModStatus.AssumeCompatible); } catch (IncompatibleInstructionException ex) { diff --git a/src/StardewModdingAPI/StardewModdingAPI.csproj b/src/StardewModdingAPI/StardewModdingAPI.csproj index 685bef1e..46f2ffb1 100644 --- a/src/StardewModdingAPI/StardewModdingAPI.csproj +++ b/src/StardewModdingAPI/StardewModdingAPI.csproj @@ -166,7 +166,7 @@ <Compile Include="Framework\Logging\ConsoleInterceptionManager.cs" /> <Compile Include="Framework\Logging\InterceptingTextWriter.cs" /> <Compile Include="Framework\Models\ManifestDependency.cs" /> - <Compile Include="Framework\Models\ModCompatibilityType.cs" /> + <Compile Include="Framework\Models\ModStatus.cs" /> <Compile Include="Framework\Models\SConfig.cs" /> <Compile Include="Framework\ModLoading\ModMetadata.cs" /> <Compile Include="Framework\Reflection\PrivateProperty.cs" /> |