From 9543971d2598f4d375374f427dfc17e615d4e67a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:11:47 -0500 Subject: update for compatibility wiki page changes --- src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs | 4 +++- src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/StardewModdingAPI.Toolkit/Framework') 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(); @@ -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 /// The custom mod page URL (if applicable). public string CustomUrl { get; set; } + /// The name of the mod which loads this content pack, if applicable. + public string ContentPackFor { get; set; } + /// The mod's compatibility with the latest stable version of the game. public WikiCompatibilityInfo Compatibility { get; set; } -- cgit From c57405aee06ca77933eadbcbcb741be085002046 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:12:02 -0500 Subject: update compatibility list --- src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/StardewModdingAPI.Toolkit/Framework') diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs index e2b3ec1d..d6f32132 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 /// /// 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 - /// | 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 + /// | character. /// public string FormerIDs { get; set; } -- cgit From 0d762faf603aac417a382ec680aaabdf7248493b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 16 Mar 2019 22:17:58 -0400 Subject: add support for suppressing warnings in mod DB --- .../Framework/ModData/ModDataModel.cs | 3 ++ .../Framework/ModData/ModDataRecord.cs | 4 +++ .../Framework/ModData/ModWarning.cs | 36 ++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs (limited to 'src/StardewModdingAPI.Toolkit/Framework') 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 /// Maps remote versions to a semantic version for update checks. public IDictionary MapRemoteVersions { get; set; } = new Dictionary(); + /// The mod warnings to suppress, even if they'd normally be shown. + public ModWarning SuppressWarnings { get; set; } + /// This field stores properties that aren't mapped to another field before they're parsed into . [JsonExtensionData] public IDictionary 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 /// The former mod IDs (if any). public string[] FormerIDs { get; } + /// The mod warnings to suppress, even if they'd normally be shown. + public ModWarning SuppressWarnings { get; set; } + /// Maps local versions to a semantic version for update checks. public IDictionary 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(model.MapLocalVersions, StringComparer.InvariantCultureIgnoreCase); this.MapRemoteVersions = new Dictionary(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 +{ + /// Indicates a detected non-error mod issue. + [Flags] + public enum ModWarning + { + /// No issues detected. + None = 0, + + /// SMAPI detected incompatible code in the mod, but was configured to load it anyway. + BrokenCodeLoaded = 1, + + /// The mod affects the save serializer in a way that may make saves unloadable without the mod. + ChangesSaveSerialiser = 2, + + /// The mod patches the game in a way that may impact stability. + PatchesGame = 4, + + /// The mod uses the dynamic keyword which won't work on Linux/Mac. + UsesDynamic = 8, + + /// The mod references specialised 'unvalided update tick' events which may impact stability. + UsesUnvalidatedUpdateTick = 16, + + /// The mod has no update keys set. + NoUpdateKeys = 32, + + /// Uses .NET APIs for filesystem access. + AccessesFilesystem = 64, + + /// Uses .NET APIs for shell or process access. + AccessesShell = 128 + } +} -- cgit