summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/Models
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-03-14 20:48:02 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-03-14 20:48:02 -0400
commit104aa314127bd816d5dbcac8c57ecb84b12f20d1 (patch)
tree5aae5fe3442a84c92d2e25688bedf52682f73ba7 /src/StardewModdingAPI/Framework/Models
parent33df1e8c94aef9cb5517524cde1edbef0cefaf9f (diff)
downloadSMAPI-104aa314127bd816d5dbcac8c57ecb84b12f20d1.tar.gz
SMAPI-104aa314127bd816d5dbcac8c57ecb84b12f20d1.tar.bz2
SMAPI-104aa314127bd816d5dbcac8c57ecb84b12f20d1.zip
let players override SMAPI incompatible-code detection if needed
Diffstat (limited to 'src/StardewModdingAPI/Framework/Models')
-rw-r--r--src/StardewModdingAPI/Framework/Models/ModCompatibility.cs (renamed from src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs)10
-rw-r--r--src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs12
-rw-r--r--src/StardewModdingAPI/Framework/Models/SConfig.cs4
3 files changed, 19 insertions, 7 deletions
diff --git a/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs b/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs
index 29e18ddb..1e71dae0 100644
--- a/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs
+++ b/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs
@@ -3,8 +3,8 @@ using Newtonsoft.Json;
namespace StardewModdingAPI.Framework.Models
{
- /// <summary>Contains abstract metadata about an incompatible mod.</summary>
- internal class IncompatibleMod
+ /// <summary>Metadata about a mod version that SMAPI should assume is compatible or broken, regardless of whether it detects incompatible code.</summary>
+ internal class ModCompatibility
{
/*********
** Accessors
@@ -30,13 +30,13 @@ namespace StardewModdingAPI.Framework.Models
/// <summary>The URL the user can check for an unofficial updated version.</summary>
public string UnofficialUpdateUrl { get; set; }
- /// <summary>A regular expression matching version strings to consider compatible, even if they technically precede <see cref="UpperVersion"/>.</summary>
- public string ForceCompatibleVersion { get; set; }
-
/// <summary>The reason phrase to show in the warning, or <c>null</c> to use the default value.</summary>
/// <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; }
+
/****
** Injected
diff --git a/src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs b/src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs
new file mode 100644
index 00000000..35edec5e
--- /dev/null
+++ b/src/StardewModdingAPI/Framework/Models/ModCompatibilityType.cs
@@ -0,0 +1,12 @@
+namespace StardewModdingAPI.Framework.Models
+{
+ /// <summary>Indicates how SMAPI should consider a mod.</summary>
+ internal enum ModCompatibilityType
+ {
+ /// <summary>Assume the mod is not compatible, even if SMAPI doesn't detect any incompatible code.</summary>
+ AssumeBroken = 0,
+
+ /// <summary>Assume the mod is compatible, even if SMAPI detects incompatible code.</summary>
+ AssumeCompatible = 1
+ }
+}
diff --git a/src/StardewModdingAPI/Framework/Models/SConfig.cs b/src/StardewModdingAPI/Framework/Models/SConfig.cs
index 558da82a..0de96297 100644
--- a/src/StardewModdingAPI/Framework/Models/SConfig.cs
+++ b/src/StardewModdingAPI/Framework/Models/SConfig.cs
@@ -12,7 +12,7 @@
/// <summary>Whether to check if a newer version of SMAPI is available on startup.</summary>
public bool CheckForUpdates { get; set; } = true;
- /// <summary>A list of mod versions which should be considered incompatible.</summary>
- public IncompatibleMod[] IncompatibleMods { get; set; }
+ /// <summary>A list of mod versions which should be considered compatible or incompatible regardless of whether SMAPI detects incompatible code.</summary>
+ public ModCompatibility[] ModCompatibility { get; set; }
}
}