summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/StardewModdingAPI.Tests/Core/ModResolverTests.cs2
-rw-r--r--src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs2
-rw-r--r--src/StardewModdingAPI/Framework/Models/ModCompatibility.cs6
-rw-r--r--src/StardewModdingAPI/Framework/Models/ModStatus.cs (renamed from src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs)7
-rw-r--r--src/StardewModdingAPI/Program.cs2
-rw-r--r--src/StardewModdingAPI/StardewModdingAPI.csproj2
6 files changed, 12 insertions, 9 deletions
diff --git a/src/StardewModdingAPI.Tests/Core/ModResolverTests.cs b/src/StardewModdingAPI.Tests/Core/ModResolverTests.cs
index 7a81c68c..bc3a0c8c 100644
--- a/src/StardewModdingAPI.Tests/Core/ModResolverTests.cs
+++ b/src/StardewModdingAPI.Tests/Core/ModResolverTests.cs
@@ -141,7 +141,7 @@ namespace StardewModdingAPI.Tests.Core
{
// arrange
Mock<IModMetadata> mock = this.GetMetadata("Mod A", new string[0], allowStatusChange: true);
- this.SetupMetadataForValidation(mock, new ModCompatibility { Compatibility = ModCompatibilityType.AssumeBroken, UpperVersion = new SemanticVersion("1.0"), UpdateUrls = new[] { "http://example.org" } });
+ this.SetupMetadataForValidation(mock, new ModCompatibility { Status = ModStatus.AssumeBroken, UpperVersion = new SemanticVersion("1.0"), UpdateUrls = new[] { "http://example.org" } });
// act
new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"));
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" />