summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework')
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs4
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs3
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs12
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs4
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs36
5 files changed, 51 insertions, 8 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs
index d3a25845..ac279d88 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs
@@ -39,7 +39,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
.WithArguments(new
{
action = "parse",
- page = "Modding:SMAPI_compatibility",
+ page = "Modding:Mod_compatibility",
format = "json"
})
.As<ResponseModel>();
@@ -98,6 +98,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
string customSourceUrl = this.GetAttribute(node, "data-custom-source");
string customUrl = this.GetAttribute(node, "data-url");
string anchor = this.GetAttribute(node, "id");
+ string contentPackFor = this.GetAttribute(node, "data-content-pack-for");
// parse stable compatibility
WikiCompatibilityInfo compatibility = new WikiCompatibilityInfo
@@ -142,6 +143,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
GitHubRepo = githubRepo,
CustomSourceUrl = customSourceUrl,
CustomUrl = customUrl,
+ ContentPackFor = contentPackFor,
Compatibility = compatibility,
BetaCompatibility = betaCompatibility,
Smapi3Status = smapi3Status,
diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs
index b71269fe..35d43758 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs
@@ -33,6 +33,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
/// <summary>The custom mod page URL (if applicable).</summary>
public string CustomUrl { get; set; }
+ /// <summary>The name of the mod which loads this content pack, if applicable.</summary>
+ public string ContentPackFor { get; set; }
+
/// <summary>The mod's compatibility with the latest stable version of the game.</summary>
public WikiCompatibilityInfo Compatibility { get; set; }
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs
index e2b3ec1d..18039762 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs
@@ -20,13 +20,8 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData
/// <remarks>
/// This uses a custom format which uniquely identifies a mod across multiple versions and
/// supports matching other fields if no ID was specified. This doesn't include the latest
- /// ID, if any. Format rules:
- /// 1. If the mod's ID changed over time, multiple variants can be separated by the
- /// <c>|</c> character.
- /// 2. Each variant can take one of two forms:
- /// - A simple string matching the mod's UniqueID value.
- /// - A JSON structure containing any of four manifest fields (ID, Name, Author, and
- /// EntryDll) to match.
+ /// ID, if any. If the mod's ID changed over time, multiple variants can be separated by the
+ /// <c>|</c> character.
/// </remarks>
public string FormerIDs { get; set; }
@@ -36,6 +31,9 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData
/// <summary>Maps remote versions to a semantic version for update checks.</summary>
public IDictionary<string, string> MapRemoteVersions { get; set; } = new Dictionary<string, string>();
+ /// <summary>The mod warnings to suppress, even if they'd normally be shown.</summary>
+ public ModWarning SuppressWarnings { get; set; }
+
/// <summary>This field stores properties that aren't mapped to another field before they're parsed into <see cref="Fields"/>.</summary>
[JsonExtensionData]
public IDictionary<string, JToken> ExtensionData { get; set; }
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
index 3949f7dc..794ad2e4 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
@@ -19,6 +19,9 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData
/// <summary>The former mod IDs (if any).</summary>
public string[] FormerIDs { get; }
+ /// <summary>The mod warnings to suppress, even if they'd normally be shown.</summary>
+ public ModWarning SuppressWarnings { get; set; }
+
/// <summary>Maps local versions to a semantic version for update checks.</summary>
public IDictionary<string, string> MapLocalVersions { get; }
@@ -40,6 +43,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData
this.DisplayName = displayName;
this.ID = model.ID;
this.FormerIDs = model.GetFormerIDs().ToArray();
+ this.SuppressWarnings = model.SuppressWarnings;
this.MapLocalVersions = new Dictionary<string, string>(model.MapLocalVersions, StringComparer.InvariantCultureIgnoreCase);
this.MapRemoteVersions = new Dictionary<string, string>(model.MapRemoteVersions, StringComparer.InvariantCultureIgnoreCase);
this.Fields = model.GetFields().ToArray();
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs
new file mode 100644
index 00000000..d61c427f
--- /dev/null
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs
@@ -0,0 +1,36 @@
+using System;
+
+namespace StardewModdingAPI.Toolkit.Framework.ModData
+{
+ /// <summary>Indicates a detected non-error mod issue.</summary>
+ [Flags]
+ public enum ModWarning
+ {
+ /// <summary>No issues detected.</summary>
+ None = 0,
+
+ /// <summary>SMAPI detected incompatible code in the mod, but was configured to load it anyway.</summary>
+ BrokenCodeLoaded = 1,
+
+ /// <summary>The mod affects the save serializer in a way that may make saves unloadable without the mod.</summary>
+ ChangesSaveSerialiser = 2,
+
+ /// <summary>The mod patches the game in a way that may impact stability.</summary>
+ PatchesGame = 4,
+
+ /// <summary>The mod uses the <c>dynamic</c> keyword which won't work on Linux/Mac.</summary>
+ UsesDynamic = 8,
+
+ /// <summary>The mod references specialised 'unvalided update tick' events which may impact stability.</summary>
+ UsesUnvalidatedUpdateTick = 16,
+
+ /// <summary>The mod has no update keys set.</summary>
+ NoUpdateKeys = 32,
+
+ /// <summary>Uses .NET APIs for filesystem access.</summary>
+ AccessesFilesystem = 64,
+
+ /// <summary>Uses .NET APIs for shell or process access.</summary>
+ AccessesShell = 128
+ }
+}