diff options
Diffstat (limited to 'src/SMAPI/Framework/Models')
-rw-r--r-- | src/SMAPI/Framework/Models/Manifest.cs | 49 | ||||
-rw-r--r-- | src/SMAPI/Framework/Models/ManifestContentPackFor.cs | 15 | ||||
-rw-r--r-- | src/SMAPI/Framework/Models/ManifestDependency.cs | 35 | ||||
-rw-r--r-- | src/SMAPI/Framework/Models/ModFolderExport.cs | 21 | ||||
-rw-r--r-- | src/SMAPI/Framework/Models/SConfig.cs | 16 |
5 files changed, 33 insertions, 103 deletions
diff --git a/src/SMAPI/Framework/Models/Manifest.cs b/src/SMAPI/Framework/Models/Manifest.cs deleted file mode 100644 index f5867cf3..00000000 --- a/src/SMAPI/Framework/Models/Manifest.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections.Generic; -using Newtonsoft.Json; -using StardewModdingAPI.Framework.Serialisation.SmapiConverters; - -namespace StardewModdingAPI.Framework.Models -{ - /// <summary>A manifest which describes a mod for SMAPI.</summary> - internal class Manifest : IManifest - { - /********* - ** Accessors - *********/ - /// <summary>The mod name.</summary> - public string Name { get; set; } - - /// <summary>A brief description of the mod.</summary> - public string Description { get; set; } - - /// <summary>The mod author's name.</summary> - public string Author { get; set; } - - /// <summary>The mod version.</summary> - public ISemanticVersion Version { get; set; } - - /// <summary>The minimum SMAPI version required by this mod, if any.</summary> - public ISemanticVersion MinimumApiVersion { get; set; } - - /// <summary>The name of the DLL in the directory that has the <see cref="IMod.Entry"/> method. Mutually exclusive with <see cref="ContentPackFor"/>.</summary> - public string EntryDll { get; set; } - - /// <summary>The mod which will read this as a content pack. Mutually exclusive with <see cref="IManifest.EntryDll"/>.</summary> - [JsonConverter(typeof(ManifestContentPackForConverter))] - public IManifestContentPackFor ContentPackFor { get; set; } - - /// <summary>The other mods that must be loaded before this mod.</summary> - [JsonConverter(typeof(ManifestDependencyArrayConverter))] - public IManifestDependency[] Dependencies { get; set; } - - /// <summary>The namespaced mod IDs to query for updates (like <c>Nexus:541</c>).</summary> - public string[] UpdateKeys { get; set; } - - /// <summary>The unique mod ID.</summary> - public string UniqueID { get; set; } - - /// <summary>Any manifest fields which didn't match a valid field.</summary> - [JsonExtensionData] - public IDictionary<string, object> ExtraFields { get; set; } - } -} diff --git a/src/SMAPI/Framework/Models/ManifestContentPackFor.cs b/src/SMAPI/Framework/Models/ManifestContentPackFor.cs deleted file mode 100644 index 7836bbcc..00000000 --- a/src/SMAPI/Framework/Models/ManifestContentPackFor.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace StardewModdingAPI.Framework.Models -{ - /// <summary>Indicates which mod can read the content pack represented by the containing manifest.</summary> - internal class ManifestContentPackFor : IManifestContentPackFor - { - /********* - ** Accessors - *********/ - /// <summary>The unique ID of the mod which can read this content pack.</summary> - public string UniqueID { get; set; } - - /// <summary>The minimum required version (if any).</summary> - public ISemanticVersion MinimumVersion { get; set; } - } -} diff --git a/src/SMAPI/Framework/Models/ManifestDependency.cs b/src/SMAPI/Framework/Models/ManifestDependency.cs deleted file mode 100644 index 97f0775a..00000000 --- a/src/SMAPI/Framework/Models/ManifestDependency.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace StardewModdingAPI.Framework.Models -{ - /// <summary>A mod dependency listed in a mod manifest.</summary> - internal class ManifestDependency : IManifestDependency - { - /********* - ** Accessors - *********/ - /// <summary>The unique mod ID to require.</summary> - public string UniqueID { get; set; } - - /// <summary>The minimum required version (if any).</summary> - public ISemanticVersion MinimumVersion { get; set; } - - /// <summary>Whether the dependency must be installed to use the mod.</summary> - public bool IsRequired { get; set; } - - - /********* - ** Public methods - *********/ - /// <summary>Construct an instance.</summary> - /// <param name="uniqueID">The unique mod ID to require.</param> - /// <param name="minimumVersion">The minimum required version (if any).</param> - /// <param name="required">Whether the dependency must be installed to use the mod.</param> - public ManifestDependency(string uniqueID, string minimumVersion, bool required = true) - { - this.UniqueID = uniqueID; - this.MinimumVersion = !string.IsNullOrWhiteSpace(minimumVersion) - ? new SemanticVersion(minimumVersion) - : null; - this.IsRequired = required; - } - } -} diff --git a/src/SMAPI/Framework/Models/ModFolderExport.cs b/src/SMAPI/Framework/Models/ModFolderExport.cs new file mode 100644 index 00000000..3b8d451a --- /dev/null +++ b/src/SMAPI/Framework/Models/ModFolderExport.cs @@ -0,0 +1,21 @@ +namespace StardewModdingAPI.Framework.Models +{ + /// <summary>Metadata exported to the mod folder.</summary> + internal class ModFolderExport + { + /// <summary>When the export was generated.</summary> + public string Exported { get; set; } + + /// <summary>The absolute path of the mod folder.</summary> + public string ModFolderPath { get; set; } + + /// <summary>The game version which last loaded the mods.</summary> + public string GameVersion { get; set; } + + /// <summary>The SMAPI version which last loaded the mods.</summary> + public string ApiVersion { get; set; } + + /// <summary>The detected mods.</summary> + public IModMetadata[] Mods { get; set; } + } +} diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs index 17169714..15671af4 100644 --- a/src/SMAPI/Framework/Models/SConfig.cs +++ b/src/SMAPI/Framework/Models/SConfig.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using StardewModdingAPI.Framework.ModData; +using StardewModdingAPI.Internal.ConsoleWriting; namespace StardewModdingAPI.Framework.Models { @@ -15,6 +14,9 @@ namespace StardewModdingAPI.Framework.Models /// <summary>Whether to check for newer versions of SMAPI and mods on startup.</summary> public bool CheckForUpdates { get; set; } + /// <summary>Whether to show beta versions as valid updates.</summary> + public bool UseBetaChannel { get; set; } = Constants.ApiVersion.IsPrerelease(); + /// <summary>SMAPI's GitHub project name, used to perform update checks.</summary> public string GitHubProjectName { get; set; } @@ -24,7 +26,13 @@ namespace StardewModdingAPI.Framework.Models /// <summary>Whether SMAPI should log more information about the game context.</summary> public bool VerboseLogging { get; set; } - /// <summary>Extra metadata about mods.</summary> - public IDictionary<string, ModDataRecord> ModData { get; set; } + /// <summary>Whether to generate a file in the mods folder with detailed metadata about the detected mods.</summary> + public bool DumpMetadata { get; set; } + + /// <summary>The console color scheme to use.</summary> + public MonitorColorScheme ColorScheme { get; set; } + + /// <summary>The mod IDs SMAPI should ignore when performing update checks or validating update keys.</summary> + public string[] SuppressUpdateChecks { get; set; } } } |