add metadata links to mod compatibility list
This commit is contained in:
parent
1053232c20
commit
48f211f544
|
@ -24,6 +24,10 @@ These changes have not been released yet.
|
|||
* Fixed map reloads not updating door warps.
|
||||
* Fixed outdoor tilesheets being seasonalised when added to an indoor location.
|
||||
|
||||
* For the mod compatibility list:
|
||||
* Clicking a mod link now automatically adds it to the visible mods when the list is filtered.
|
||||
* Added metadata links to advanced info, if any.
|
||||
|
||||
* For modders:
|
||||
* Mods are now loaded much earlier in the game launch. This lets mods intercept any content asset, but the game is not fully initialised when `Entry` is called (use the `GameLaunched` event if you need to run code when the game is initialised).
|
||||
* Added support for content pack translations.
|
||||
|
|
|
@ -127,6 +127,15 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
|
|||
}
|
||||
}
|
||||
|
||||
// parse links
|
||||
List<Tuple<Uri, string>> metadataLinks = new List<Tuple<Uri, string>>();
|
||||
foreach (HtmlNode linkElement in node.Descendants("td").Last().Descendants("a").Skip(1)) // skip anchor link
|
||||
{
|
||||
string text = linkElement.InnerText.Trim();
|
||||
Uri url = new Uri(linkElement.GetAttributeValue("href", ""));
|
||||
metadataLinks.Add(Tuple.Create(url, text));
|
||||
}
|
||||
|
||||
// yield model
|
||||
yield return new WikiModEntry
|
||||
{
|
||||
|
@ -143,6 +152,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
|
|||
Compatibility = compatibility,
|
||||
BetaCompatibility = betaCompatibility,
|
||||
Warnings = warnings,
|
||||
MetadataLinks = metadataLinks.ToArray(),
|
||||
Anchor = anchor
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
|
||||
{
|
||||
/// <summary>A mod entry in the wiki list.</summary>
|
||||
|
@ -48,6 +51,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
|
|||
/// <summary>The human-readable warnings for players about this mod.</summary>
|
||||
public string[] Warnings { get; set; }
|
||||
|
||||
/// <summary>Extra metadata links (usually for open pull requests).</summary>
|
||||
public Tuple<Uri, string>[] MetadataLinks { get; set; }
|
||||
|
||||
/// <summary>The link anchor for the mod entry in the wiki compatibility list.</summary>
|
||||
public string Anchor { get; set; }
|
||||
}
|
||||
|
|
|
@ -58,6 +58,9 @@ namespace StardewModdingAPI.Web.Framework.Caching.Wiki
|
|||
/// <summary>The human-readable warnings for players about this mod.</summary>
|
||||
public string[] Warnings { get; set; }
|
||||
|
||||
/// <summary>Extra metadata links (usually for open pull requests).</summary>
|
||||
public Tuple<Uri, string>[] MetadataLinks { get; set; }
|
||||
|
||||
/// <summary>The link anchor for the mod entry in the wiki compatibility list.</summary>
|
||||
public string Anchor { get; set; }
|
||||
|
||||
|
@ -122,6 +125,7 @@ namespace StardewModdingAPI.Web.Framework.Caching.Wiki
|
|||
this.CustomSourceUrl = mod.CustomSourceUrl;
|
||||
this.CustomUrl = mod.CustomUrl;
|
||||
this.ContentPackFor = mod.ContentPackFor;
|
||||
this.MetadataLinks = mod.MetadataLinks;
|
||||
this.Warnings = mod.Warnings;
|
||||
this.Anchor = mod.Anchor;
|
||||
|
||||
|
@ -156,6 +160,7 @@ namespace StardewModdingAPI.Web.Framework.Caching.Wiki
|
|||
CustomUrl = this.CustomUrl,
|
||||
ContentPackFor = this.ContentPackFor,
|
||||
Warnings = this.Warnings,
|
||||
MetadataLinks = this.MetadataLinks,
|
||||
Anchor = this.Anchor,
|
||||
|
||||
// stable compatibility
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using StardewModdingAPI.Toolkit.Framework.Clients.Wiki;
|
||||
|
@ -37,6 +38,9 @@ namespace StardewModdingAPI.Web.ViewModels
|
|||
/// <summary>The human-readable warnings for players about this mod.</summary>
|
||||
public string[] Warnings { get; set; }
|
||||
|
||||
/// <summary>Extra metadata links (usually for open pull requests).</summary>
|
||||
public Tuple<Uri, string>[] MetadataLinks { get; set; }
|
||||
|
||||
/// <summary>A unique identifier for the mod that can be used in an anchor URL.</summary>
|
||||
public string Slug { get; set; }
|
||||
|
||||
|
@ -61,6 +65,7 @@ namespace StardewModdingAPI.Web.ViewModels
|
|||
this.BetaCompatibility = entry.BetaCompatibility != null ? new ModCompatibilityModel(entry.BetaCompatibility) : null;
|
||||
this.ModPages = this.GetModPageUrls(entry).ToArray();
|
||||
this.Warnings = entry.Warnings;
|
||||
this.MetadataLinks = entry.MetadataLinks;
|
||||
this.Slug = entry.Anchor;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,14 @@
|
|||
<span v-else class="mod-closed-source">no source</span>
|
||||
</td>
|
||||
<td>
|
||||
<small><a v-bind:href="'#' + mod.Slug">#</a></small>
|
||||
<small>
|
||||
<a v-bind:href="'#' + mod.Slug">#</a>
|
||||
<span v-show="showAdvanced">
|
||||
<template v-for="(link, i) in mod.MetadataLinks">
|
||||
<a v-bind:href="link.Item1">{{link.Item2}}</a>
|
||||
</template>
|
||||
</span>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue