diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-03-17 21:55:38 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-03-17 21:55:38 -0400 |
commit | 013255d89e1a802e05f9fd61a16701ca73fa4411 (patch) | |
tree | 684714b18faba6d4413a106f885bcba18a2e5edb /src/StardewModdingAPI.Toolkit/Framework/ModData | |
parent | 10c7192bb9f06ff96b9b98a812d9f72a8d77ac76 (diff) | |
parent | 4a494c67bdfe2c07ef5c49c55541a0f6e29627cf (diff) | |
download | SMAPI-013255d89e1a802e05f9fd61a16701ca73fa4411.tar.gz SMAPI-013255d89e1a802e05f9fd61a16701ca73fa4411.tar.bz2 SMAPI-013255d89e1a802e05f9fd61a16701ca73fa4411.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModData')
3 files changed, 45 insertions, 7 deletions
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 + } +} |