diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-23 20:53:12 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-23 20:53:12 -0400 |
commit | 2d36105c33ffba77eb979ef6ef0d2e7d906b09bc (patch) | |
tree | fe74c3eb7dea4e6e7d59c00cab2e2308c43da3d0 /src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs | |
parent | a149f82b7a00d1ebf5ab33e529be93ce70873947 (diff) | |
download | SMAPI-2d36105c33ffba77eb979ef6ef0d2e7d906b09bc.tar.gz SMAPI-2d36105c33ffba77eb979ef6ef0d2e7d906b09bc.tar.bz2 SMAPI-2d36105c33ffba77eb979ef6ef0d2e7d906b09bc.zip |
drop support for SMAPI 1.x (#360)
Diffstat (limited to 'src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs b/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs index 6b19db5c..87b6a99c 100644 --- a/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs +++ b/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -109,17 +109,6 @@ namespace StardewModdingAPI.Framework.ModLoading ModCompatibility compatibility = mod.Compatibility; if (compatibility?.Compatibility == ModCompatibilityType.AssumeBroken) { -#if SMAPI_1_x - bool hasOfficialUrl = mod.Compatibility.UpdateUrls.Length > 0; - bool hasUnofficialUrl = mod.Compatibility.UpdateUrls.Length > 1; - - string reasonPhrase = compatibility.ReasonPhrase ?? "it's not compatible with the latest version of the game or SMAPI"; - string error = $"{reasonPhrase}. Please check for a version newer than {compatibility.UpperVersionLabel ?? compatibility.UpperVersion.ToString()} here:"; - if (hasOfficialUrl) - error += !hasUnofficialUrl ? $" {compatibility.UpdateUrls[0]}" : $"{Environment.NewLine}- official mod: {compatibility.UpdateUrls[0]}"; - if (hasUnofficialUrl) - error += $"{Environment.NewLine}- unofficial update: {compatibility.UpdateUrls[1]}"; -#else string reasonPhrase = compatibility.ReasonPhrase ?? "it's no longer compatible"; string error = $"{reasonPhrase}. Please check for a "; if (mod.Manifest.Version.Equals(compatibility.UpperVersion) && compatibility.UpperVersionLabel == null) @@ -127,7 +116,6 @@ namespace StardewModdingAPI.Framework.ModLoading else error += $"version newer than {compatibility.UpperVersionLabel ?? compatibility.UpperVersion.ToString()}"; error += " at " + string.Join(" or ", compatibility.UpdateUrls); -#endif mod.SetStatus(ModMetadataStatus.Failed, error); continue; @@ -150,7 +138,6 @@ namespace StardewModdingAPI.Framework.ModLoading } // validate required fields -#if !SMAPI_1_x { List<string> missingFields = new List<string>(3); @@ -164,11 +151,9 @@ namespace StardewModdingAPI.Framework.ModLoading if (missingFields.Any()) mod.SetStatus(ModMetadataStatus.Failed, $"its manifest is missing required fields ({string.Join(", ", missingFields)})."); } -#endif } // validate IDs are unique -#if !SMAPI_1_x { var duplicatesByID = mods .GroupBy(mod => mod.Manifest?.UniqueID?.Trim(), mod => mod, StringComparer.InvariantCultureIgnoreCase) @@ -183,7 +168,6 @@ namespace StardewModdingAPI.Framework.ModLoading } } } -#endif } /// <summary>Sort the given mods by the order they should be loaded.</summary> @@ -264,12 +248,7 @@ namespace StardewModdingAPI.Framework.ModLoading ID = entry.UniqueID, MinVersion = entry.MinimumVersion, Mod = dependencyMod, - IsRequired = -#if SMAPI_1_x - true -#else - entry.IsRequired -#endif + IsRequired = entry.IsRequired } ) .ToArray(); |