Line 1: |
Line 1: |
| + | This module provides the table structure and data for the [[Modding:Mod compatibility]] list. |
| + | |
| ==Examples== | | ==Examples== |
| ===Compatible mod=== | | ===Compatible mod=== |
| <pre> | | <pre> |
| {{#invoke:SMAPI compatibility|entry | | {{#invoke:SMAPI compatibility|entry |
− | |name = Lookup Anything | + | |name = Lookup Anything |
− | |author = Pathoschild | + | |author = Pathoschild |
− | |id = Pathoschild.LookupAnything | + | |id = Pathoschild.LookupAnything |
− | |nexus id = 541 | + | |nexus = 541 |
− | |github = Pathoschild/StardewMods | + | |github = Pathoschild/StardewMods |
| }} | | }} |
| </pre> | | </pre> |
Line 13: |
Line 15: |
| {{#invoke:SMAPI compatibility|header}} | | {{#invoke:SMAPI compatibility|header}} |
| {{#invoke:SMAPI compatibility|entry | | {{#invoke:SMAPI compatibility|entry |
− | |name = Lookup Anything | + | |name = Lookup Anything |
− | |author = Pathoschild | + | |author = Pathoschild |
− | |id = Pathoschild.LookupAnything | + | |id = Pathoschild.LookupAnything |
− | |nexus id = 541 | + | |nexus = 541 |
− | |github = Pathoschild/StardewMods | + | |github = Pathoschild/StardewMods |
| }} | | }} |
| {{#invoke:SMAPI compatibility|footer}} | | {{#invoke:SMAPI compatibility|footer}} |
Line 24: |
Line 26: |
| <pre> | | <pre> |
| {{#invoke:SMAPI compatibility|entry | | {{#invoke:SMAPI compatibility|entry |
− | |name = Lookup Anything | + | |name = Lookup Anything |
− | |author = Pathoschild | + | |author = Pathoschild |
− | |id = Pathoschild.LookupAnything | + | |id = Pathoschild.LookupAnything |
− | |nexus id = 541 | + | |nexus = 541 |
− | |github = Pathoschild/StardewMods | + | |github = Pathoschild/StardewMods |
| + | |
| |summary = | | |summary = |
| |broke in = Stardew Valley 1.2 | | |broke in = Stardew Valley 1.2 |
Line 35: |
Line 38: |
| {{#invoke:SMAPI compatibility|header}} | | {{#invoke:SMAPI compatibility|header}} |
| {{#invoke:SMAPI compatibility|entry | | {{#invoke:SMAPI compatibility|entry |
− | |name = Lookup Anything | + | |name = Lookup Anything |
− | |author = Pathoschild | + | |author = Pathoschild |
− | |id = Pathoschild.LookupAnything | + | |id = Pathoschild.LookupAnything |
− | |nexus id = 541 | + | |nexus = 541 |
− | |github = Pathoschild/StardewMods | + | |github = Pathoschild/StardewMods |
| + | |
| |summary = | | |summary = |
| |broke in = Stardew Valley 1.2 | | |broke in = Stardew Valley 1.2 |
Line 53: |
Line 57: |
| {{#invoke:SMAPI compatibility|header}} | | {{#invoke:SMAPI compatibility|header}} |
| {{#invoke:SMAPI compatibility|entry | | {{#invoke:SMAPI compatibility|entry |
− | |name = Lookup Anything | + | |name = Lookup Anything |
− | |author = Pathoschild | + | |author = Pathoschild |
− | |id = Pathoschild.LookupAnything | + | |id = Pathoschild.LookupAnything |
− | |nexus id = 541 | + | |nexus = 541 |
− | |github = Pathoschild/StardewMods | + | |github = Pathoschild/StardewMods |
| + | |
| |summary = | | |summary = |
| |broke in = Stardew Valley 1.2 | | |broke in = Stardew Valley 1.2 |
Line 66: |
Line 71: |
| | | |
| ==Usage== | | ==Usage== |
| + | ===Limitations=== |
| + | The name, author, and id arguments are comma-separated. If the actual value contains a comma, use <code>&#44;</code> instead. |
| + | |
| ===Main fields (shown above)=== | | ===Main fields (shown above)=== |
| {| class="wikitable" | | {| class="wikitable" |
Line 73: |
Line 81: |
| |- | | |- |
| | <code>name</code> | | | <code>name</code> |
− | | The normalised display name for the mod. Combine with <code>name2</code> (see below) to add alternate names. | + | | The normalised display name for the mod. Delimit alternate names with commas. |
| |- | | |- |
| | <code>author</code> | | | <code>author</code> |
− | | The name of the author, as shown on Nexus or in its <tt>manifest.json</tt> file. Combine with <code>author2</code> (see below) to add alternate names. | + | | The name of the author, as shown on Nexus or in its <samp>manifest.json</samp> file. Delimit alternate names with commas. |
| |- | | |- |
| | <code>id</code> | | | <code>id</code> |
− | | The latest unique mod ID, as listed in its <tt>manifest.json</tt> file. In rare cases where there are parallel current releases with different IDs, this can be comma-delimited. For very old mods with no ID, use <tt>none</tt> to disable validation checks. | + | | The latest unique mod ID, as listed in its <samp>manifest.json</samp> file. Delimit alternate/older IDs with commas (ideally in latest to oldest order). For very old mods with no ID, use <samp>none</samp> to disable validation checks. |
| |- | | |- |
− | | <code>nexus id</code> | + | | <code>nexus</code> |
| | The mod's unique ID on Nexus (if any). This is the number in the mod page's URL. | | | The mod's unique ID on Nexus (if any). This is the number in the mod page's URL. |
| |- | | |- |
| | <code>github</code> | | | <code>github</code> |
− | | The mod's GitHub repository in the form <tt>owner/repo</tt>. | + | | The mod's GitHub repository in the form <samp>owner/repo</samp>. |
| |- | | |- |
| | <code>summary</code> | | | <code>summary</code> |
Line 109: |
Line 117: |
| | The unofficial update's version number, if any. | | | The unofficial update's version number, if any. |
| |- | | |- |
− | | <code>old ids</code> | + | | <code>chucklefish</code> |
− | | IDs which identify older versions of this mod. | + | | The mod's ID in the [https://community.playstarbound.com/resources/categories/stardew-valley.22/ Chucklefish mod repository]. |
| + | |- |
| + | | <code>curse</code> |
| + | | The mod's project ID and key in the [https://www.curseforge.com/stardewvalley CurseForge mod repository]. The ID is shown on the mod page next to "Project ID", and the key is shown in the mod page's URL. This must be in the form <code>id,key</code>. |
| |- | | |- |
− | | <code>cf id</code> | + | | <code>moddrop</code> |
− | | The mod's ID in the Chucklefish mod repository. | + | | The mod's ID in the [https://www.moddrop.com/stardew-valley/ ModDrop mod repository]. |
| |- | | |- |
| | <code>url</code> | | | <code>url</code> |
− | | The arbitrary mod URL, if not on Nexus or Chucklefish. Avoid if possible, since this makes crossreferencing more difficult. | + | | The arbitrary mod URL, if not on a known mod site. Avoid if possible, since this makes crossreferencing more difficult. |
| |- | | |- |
| | <code>source</code> | | | <code>source</code> |
| | An arbitrary source code URL, if not on GitHub. Avoid if possible, since this makes crossreferencing more difficult. | | | An arbitrary source code URL, if not on GitHub. Avoid if possible, since this makes crossreferencing more difficult. |
| |- | | |- |
− | | <code>name2</code><br /><code>author2</code> | + | | <code>warnings</code> |
− | | Adds alternate mod and author names. | + | | Text explaining additional compatibility warnings about the mod (''e.g.,'' not compatible with Linux/Mac). |
− | |-
| |
− | | <code>hide-url</code>
| |
− | | Use this instead of (<code>url</code>) to move it into a superscript link. Mainly useful for broken mods with a workaround, so players don't automatically click through to the old mod.
| |
| |- | | |- |
− | | <code>links</code> | + | | <code>content pack for</code> |
− | | A comma-delimited list of URLs to add as superscript links. Mainly useful for linking to pull requests. | + | | The name of the mod which loads this content pack. |
| |- | | |- |
− | | <code>warnings</code> | + | | <code>dev note</code> |
− | | Text explaining additional compatibility warnings about the mod (e.g. not compatible with Linux/Mac). | + | | Special notes intended for developers who maintain unofficial updates or submit pull requests. |
| |} | | |} |
| | | |
| + | <!-- set 'enableBeta = true' in Lua code to enable these |
| ===Beta fields=== | | ===Beta fields=== |
| When there's a Stardew Valley beta, some mods may have different compatibility statuses for stable vs beta. You can specify these optional fields to specify a different beta status. | | When there's a Stardew Valley beta, some mods may have different compatibility statuses for stable vs beta. You can specify these optional fields to specify a different beta status. |
Line 157: |
Line 166: |
| | The unofficial update's version number, if any. | | | The unofficial update's version number, if any. |
| |} | | |} |
− | | + | --> |
| ===Valid statuses=== | | ===Valid statuses=== |
| {| class="wikitable" | | {| class="wikitable" |
Line 171: |
Line 180: |
| |- | | |- |
| | <code>unofficial</code> | | | <code>unofficial</code> |
− | | The mod is compatible using an unofficial update. There's no need to specify this; if you also set <tt>unofficial url</tt> and <tt>unofficial version</tt>, you can remove the status field. | + | | The mod is compatible using an unofficial update. There's no need to specify this; if you also set <samp>unofficial url</samp> and <samp>unofficial version</samp>, you can remove the status field. |
| |- | | |- |
| | <code>workaround</code> | | | <code>workaround</code> |
− | | The mod isn't compatible, but the player can fix it or there's a good alternative. A summary should be provided manually. If you also set <tt>unofficial url</tt> and <tt>unofficial version</tt>, you can remove the status field. | + | | The mod isn't compatible, but the player can fix it or there's a good alternative. A summary should be provided manually. If you also set <samp>unofficial url</samp> and <samp>unofficial version</samp>, you can remove the status field. |
| |- | | |- |
| | <code>broken</code> | | | <code>broken</code> |
Line 184: |
Line 193: |
| | <code>obsolete</code> | | | <code>obsolete</code> |
| | The mod is no longer needed and should be removed. | | | The mod is no longer needed and should be removed. |
| + | |- |
| + | | <code>unknown</code> |
| + | | The mod's compatibility status hasn't been tested. This should only be used as a placeholder (''e.g.,'' when adding a new beta), it should never be used long since that defeats the purpose of the compatibility list. |
| |} | | |} |
| | | |
− | ==Script==
| + | [[Category:Modding Modules]] |
− | This script generates the template call when run from a Nexus or Chucklefish mod page.
| |
− | <syntaxhighlight lang="javascript">
| |
− | switch(location.host)
| |
− | {
| |
− | case "www.nexusmods.com":
| |
− | var url = location.origin + location.pathname.replace(/\/*$/, '');
| |
− | var name = $(".header-name").text();
| |
− | var author = $(".uploader a").text();
| |
− | var author2 = $(".header-author strong").text();
| |
− | break;
| |
− | | |
− | case "community.playstarbound.com":
| |
− | var url = location.origin + location.pathname.replace(/\/*$/, '');
| |
− | var name = $.trim($("h1:first").contents().first().text());
| |
− | var author = $(".primaryContent[data-author]:first").attr("data-author");
| |
− | break;
| |
− | | |
− | default:
| |
− | throw `Unknown domain: ${location.host}`;
| |
− | }
| |
− | | |
− | var template = `
| |
− | {{/entry
| |
− | |name = ${name}
| |
− | |author = ${author}`;
| |
− | if(author2 && author2 != author)
| |
− | template += '\n' + ` |author2 = ${author2}`;
| |
− | template += `
| |
− | |url = ${url}
| |
− | |status = ok
| |
− | |summary =
| |
− | |source =
| |
− | }}
| |
− | `;
| |
− | </syntaxhighlight>
| |
− | | |
− | [[Category:Modding]] | |