add ModDrop to mod compatibility page (#604)

This commit is contained in:
Jesse Plamondon-Willard 2018-12-02 15:16:24 -05:00
parent 84c406ce36
commit f0a5a3d154
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
6 changed files with 23 additions and 0 deletions

View File

@ -294,6 +294,8 @@ namespace StardewModdingAPI.Web.Controllers
yield return $"Nexus:{entry.NexusID}";
if (entry.ChucklefishID.HasValue)
yield return $"Chucklefish:{entry.ChucklefishID}";
if (entry.ModDropID.HasValue)
yield return $"ModDrop:{entry.ModDropID}";
}
}

View File

@ -96,6 +96,11 @@ namespace StardewModdingAPI.Web.ViewModels
anyFound = true;
yield return new ModLinkModel($"https://community.playstarbound.com/resources/{entry.ChucklefishID}", "Chucklefish");
}
if (entry.ModDropID.HasValue)
{
anyFound = true;
yield return new ModLinkModel($"https://www.moddrop.com/sdv/mod/467243/{entry.ModDropID}", "ModDrop");
}
// fallback
if (!anyFound && !string.IsNullOrWhiteSpace(entry.CustomUrl))

View File

@ -73,6 +73,11 @@ smapi.modList = function (mods) {
id: "show-chucklefish",
value: true
},
moddrop: {
label: "ModDrop",
id: "show-moddrop",
value: true
},
nexus: {
label: "Nexus",
id: "show-nexus",
@ -179,6 +184,8 @@ smapi.modList = function (mods) {
if (!filters.download.chucklefish.value)
ignoreSites.push("Chucklefish");
if (!filters.download.moddrop.value)
ignoreSites.push("ModDrop");
if (!filters.download.nexus.value)
ignoreSites.push("Nexus");
if (!filters.download.custom.value)

View File

@ -28,6 +28,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
/// <summary>The mod ID in the Chucklefish mod repo.</summary>
public int? ChucklefishID { get; set; }
/// <summary>The mod ID in the ModDrop mod repo.</summary>
public int? ModDropID { get; set; }
/// <summary>The GitHub repository in the form 'owner/repo'.</summary>
public string GitHubRepo { get; set; }
@ -77,6 +80,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
this.Name = wiki.Name.FirstOrDefault();
this.NexusID = wiki.NexusID;
this.ChucklefishID = wiki.ChucklefishID;
this.ModDropID = wiki.ModDropID;
this.GitHubRepo = wiki.GitHubRepo;
this.CustomSourceUrl = wiki.CustomSourceUrl;
this.CustomUrl = wiki.CustomUrl;

View File

@ -93,6 +93,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
string[] warnings = this.GetAttributeAsCsv(node, "data-warnings");
int? nexusID = this.GetAttributeAsNullableInt(node, "data-nexus-id");
int? chucklefishID = this.GetAttributeAsNullableInt(node, "data-cf-id");
int? modDropID = this.GetAttributeAsNullableInt(node, "data-moddrop-id");
string githubRepo = this.GetAttribute(node, "data-github");
string customSourceUrl = this.GetAttribute(node, "data-custom-source");
string customUrl = this.GetAttribute(node, "data-url");
@ -133,6 +134,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
Author = authors,
NexusID = nexusID,
ChucklefishID = chucklefishID,
ModDropID = modDropID,
GitHubRepo = githubRepo,
CustomSourceUrl = customSourceUrl,
CustomUrl = customUrl,

View File

@ -21,6 +21,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
/// <summary>The mod ID in the Chucklefish mod repo.</summary>
public int? ChucklefishID { get; set; }
/// <summary>The mod ID in the ModDrop mod repo.</summary>
public int? ModDropID { get; set; }
/// <summary>The GitHub repository in the form 'owner/repo'.</summary>
public string GitHubRepo { get; set; }