summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI.Toolkit')
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs3
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs4
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs36
3 files changed, 43 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs
index d6f32132..18039762 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs
@@ -31,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
+ }
+}