diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-02-21 23:05:17 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-02-21 23:05:17 -0500 |
commit | db011ee751bdfb8bbd9abbeb706966db4c4e2461 (patch) | |
tree | 4c1ca1c2fb2db41ac0d8b337e2f17209b4ad66f5 /src/SMAPI.Toolkit | |
parent | f1505b0ebe5c8fa7cf3c160231f0ed7d1bd6619a (diff) | |
parent | 9c4c10d2d22cbf67ccadbd35fdf1ffced0541cc2 (diff) | |
download | SMAPI-db011ee751bdfb8bbd9abbeb706966db4c4e2461.tar.gz SMAPI-db011ee751bdfb8bbd9abbeb706966db4c4e2461.tar.bz2 SMAPI-db011ee751bdfb8bbd9abbeb706966db4c4e2461.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Toolkit')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs | 6 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs index 89a22eaf..da312471 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs @@ -50,13 +50,13 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki doc.LoadHtml(html); // fetch game versions - string stableVersion = doc.DocumentNode.SelectSingleNode("div[@class='game-stable-version']")?.InnerText; - string betaVersion = doc.DocumentNode.SelectSingleNode("div[@class='game-beta-version']")?.InnerText; + string stableVersion = doc.DocumentNode.SelectSingleNode("//div[@class='game-stable-version']")?.InnerText; + string betaVersion = doc.DocumentNode.SelectSingleNode("//div[@class='game-beta-version']")?.InnerText; if (betaVersion == stableVersion) betaVersion = null; // find mod entries - HtmlNodeCollection modNodes = doc.DocumentNode.SelectNodes("table[@id='mod-list']//tr[@class='mod']"); + HtmlNodeCollection modNodes = doc.DocumentNode.SelectNodes("//table[@id='mod-list']//tr[@class='mod']"); if (modNodes == null) throw new InvalidOperationException("Can't parse wiki compatibility list, no mods found."); diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 86a97016..fd206d9d 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -177,12 +177,17 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning } // get mod type - ModType type = ModType.Invalid; - if (manifest != null) + ModType type; { - type = !string.IsNullOrWhiteSpace(manifest.ContentPackFor?.UniqueID) - ? ModType.ContentPack - : ModType.Smapi; + bool isContentPack = !string.IsNullOrWhiteSpace(manifest?.ContentPackFor?.UniqueID); + bool isSmapi = !string.IsNullOrWhiteSpace(manifest?.EntryDll); + + if (isContentPack == isSmapi) + type = ModType.Invalid; + else if (isContentPack) + type = ModType.ContentPack; + else + type = ModType.Smapi; } // build result |