Difference between revisions of "Modding:Mod compatibility/entry"

From Stardew Valley Wiki
Jump to navigation Jump to search
(fix URLs being htmlified in metadata)
(expand metadata)
Line 31: Line 31:
 
-->
 
-->
 
|- class="mod" id="{{{name}}}" data-id="{{#if:{{{id|}}}{{{old ids|}}}|{{#ifeq:{{{id}}}|none||{{{id}}}{{#if:{{{old ids|}}}|,}}}}{{{old ids|}}}}}" {{#if:{{{nexus id|}}}|data-nexus-id="{{{nexus id|}}}"}} {{#if:{{{cf id|}}}|data-chucklefish-id="{{{cf id|}}}"}} {{#if:{{{github|}}}|data-github="{{{github}}}"}} {{#if:{{{source|}}}|data-custom-source="{{{source|}}}"}} {{#if:{{{url|}}}|data-custom-url="{{{url}}}"}} data-status="{{#arrayindex:vars|1}}" data-beta-status="{{#arrayindex:vars|3}}" {{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} {{#if:{{{beta unofficial version|}}}|data-beta-unofficial-version="{{{beta unofficial version}}}"}} style="line-height: 1em; {{#switch:{{#arrayindex:vars|3}} |ok|optional=background: #9F9; |workaround|unofficial=background: #CF9; |broken=background: #F99; |obsolete|abandoned=background: #999}}"
 
|- class="mod" id="{{{name}}}" data-id="{{#if:{{{id|}}}{{{old ids|}}}|{{#ifeq:{{{id}}}|none||{{{id}}}{{#if:{{{old ids|}}}|,}}}}{{{old ids|}}}}}" {{#if:{{{nexus id|}}}|data-nexus-id="{{{nexus id|}}}"}} {{#if:{{{cf id|}}}|data-chucklefish-id="{{{cf id|}}}"}} {{#if:{{{github|}}}|data-github="{{{github}}}"}} {{#if:{{{source|}}}|data-custom-source="{{{source|}}}"}} {{#if:{{{url|}}}|data-custom-url="{{{url}}}"}} data-status="{{#arrayindex:vars|1}}" data-beta-status="{{#arrayindex:vars|3}}" {{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} {{#if:{{{beta unofficial version|}}}|data-beta-unofficial-version="{{{beta unofficial version}}}"}} style="line-height: 1em; {{#switch:{{#arrayindex:vars|3}} |ok|optional=background: #9F9; |workaround|unofficial=background: #CF9; |broken=background: #F99; |obsolete|abandoned=background: #999}}"
| {{#if:{{{nexus id|}}}|[{{nexus mod|{{{nexus id}}} {{{name|}}}]}}|{{#if:{{{cf id|}}}|[https://community.playstarbound.com/resources/{{urlencode:{{{cf id}}}}} {{{name}}}]|{{#if:{{{url|}}}|[{{{url}}} {{{name}}}]|{{{name}}}}}}}}}{{#if:{{{name2|}}}|<br /><small style="font-size:0.75em;">(aka {{{name2}}})</small>}}
+
| {{#if:{{{nexus id|}}}|[{{nexus mod|{{{nexus id}}} <span class="mod-name">{{{name}}}</span>]}}|{{#if:{{{cf id|}}}|[https://community.playstarbound.com/resources/{{urlencode:{{{cf id}}}}} <span class="mod-name">{{{name}}}</span>]|{{#if:{{{url|}}}|[{{{url}}} <span class="mod-name">{{{name|}}}</span>]|<span class="mod-name">{{{name|}}}</span>}}}}}}{{#if:{{{name2|}}}|<br /><small style="font-size:0.75em;">(aka <span class="mod-name2">{{{name2}}}</span>)</small>}}
| {{{author}}}{{#if:{{{author2|}}}|<br /><small style="font-size:0.75em;">(aka {{{author2}}})</small>}}
+
| <span class="mod-author">{{{author}}}</span>{{#if:{{{author2|}}}|<br /><small style="font-size:0.75em;">(aka <span class="mod-author2">{{{author2}}}</span>)</small>}}
 
|class="summary"|<!--
 
|class="summary"|<!--
  
 
stable label (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|'''{{version|stable|link=0}}:'''&#32;}}<!--
 
stable label (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|'''{{version|stable|link=0}}:'''&#32;}}<!--
  
stable summary--><span class="data-summary">{{#switch:{{#arrayindex:vars|0}}
+
stable summary--><span class="data-summary mod-summary">{{Modding:SMAPI compatibility/entry/summary
|ok        = ✓ {{#if:{{{summary|}}}|{{{summary}}}|use latest version.}}
+
  |status            = {{#arrayindex:vars|0}}
|optional   = ✓ {{#if:{{{summary|}}}|{{{summary}}}|use optional download<ref name="optional-update" />.}}
+
  |summary            = {{{summary|}}}
|unofficial = ⚠ broken{{#if:{{{unofficial url|}}}|, use [{{{unofficial url}}} unofficial update]{{#if:{{{unofficial version|}}}|&#32;(<small>{{{unofficial version}}}</small>)}}|{{{unofficial url}}}}}.
+
   |unofficial url    = {{{unofficial url|}}}
|workaround = ⚠ broken, {{{summary}}}
+
  |unofficial version = {{{unofficial version|}}}
|broken-open  = ↻ broken, {{#if:{{{summary|}}}|{{{summary}}}|not updated yet.}}
 
|broken-closed = ✖ broken, {{#if:{{{summary|}}}|{{{summary}}}|not open-source.}}
 
|obsolete  = ✖ {{#if:{{{summary|}}}|{{{summary}}}|obsolete.}}
 
|abandoned  = ✖ {{#if:{{{summary|}}}|{{{summary}}}|no longer maintained.}}
 
 
}}</span><!--
 
}}</span><!--
  
beta summary (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<br />'''{{version|beta|link=0}}-beta:'''&#32;<span class="data-beta-summary">{{#switch:{{#arrayindex:vars|2}}
+
beta summary (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<br />'''{{version|beta|link=0}}-beta:'''&#32;<span class="data-beta-summary mod-beta-summary">{{Modding:SMAPI compatibility/entry/summary
|ok        = ✓ {{#if:{{{beta summary|}}}|{{{beta summary}}}|use latest version.}}
+
  |status            = {{#arrayindex:vars|2}}
|optional   = ✓ {{#if:{{{beta summary|}}}|{{{beta summary}}}|use optional download<ref name="optional-update" />.}}
+
  |summary            = {{{beta summary|}}}
|unofficial = ⚠ broken{{#if:{{{beta unofficial url|}}}|, use [{{{beta unofficial url}}} unofficial update]{{#if:{{{beta unofficial version|}}}|&#32;(<small>{{{beta unofficial version}}}</small>)}}|{{{beta unofficial url}}}}}.
+
   |unofficial url    = {{{beta unofficial url|}}}
|workaround = ⚠ broken, {{{beta summary}}}
+
  |unofficial version = {{{beta unofficial version|}}}
|broken-open  = ↻ broken, {{#if:{{{beta summary|}}}|{{{beta summary}}}|not updated yet.}}
 
|broken-closed = ✖ broken, {{#if:{{{beta summary|}}}|{{{beta summary}}}|not open-source.}}
 
|obsolete  = ✖ {{#if:{{{beta summary|}}}|{{{beta summary}}}|obsolete.}}
 
|abandoned  = ✖ {{#if:{{{beta summary|}}}|{{{beta summary}}}|no longer maintained.}}
 
 
}}</span>}}{{#if:{{{warnings|}}}|<br />⚠&#32;{{#arraydefine:warningArray|{{{warnings}}}}}{{#arrayprint:warningArray|<br />⚠&#32;}}}}
 
}}</span>}}{{#if:{{{warnings|}}}|<br />⚠&#32;{{#arraydefine:warningArray|{{{warnings}}}}}{{#arrayprint:warningArray|<br />⚠&#32;}}}}
 
| <small>{{#if:{{{beta broke in|}}}|{{{beta broke in}}}|{{{broke in|}}}}}</small>
 
| <small>{{#if:{{{beta broke in|}}}|{{{beta broke in}}}|{{{broke in|}}}}}</small>
Line 65: Line 57:
 
--><div class="mod-metadata" style="display: none;">
 
--><div class="mod-metadata" style="display: none;">
 
   <div class="mod-id">{{#if:{{{id|}}}{{{old ids|}}}|{{#ifeq:{{{id}}}|none||{{{id}}}{{#if:{{{old ids|}}}|,}}}}{{{old ids|}}}}}</div>
 
   <div class="mod-id">{{#if:{{{id|}}}{{{old ids|}}}|{{#ifeq:{{{id}}}|none||{{{id}}}{{#if:{{{old ids|}}}|,}}}}{{{old ids|}}}}}</div>
  <div class="mod-name">{{{name|}}}</div>
 
  {{#if:{{{name2|}}}|<div class="mod-name2">{{{name2|}}}</div>}}
 
  <div class="mod-author">{{{author|}}}</div>
 
  {{#if:{{{author2|}}}|<div class="mod-author2">{{{author2|}}}</div>}}
 
 
   <div class="mod-url">{{#tag:nowiki|{{#if:{{{nexus id|}}}|{{nexus mod|{{{nexus id}}}}}|{{#if:{{{cf id|}}}|https://community.playstarbound.com/resources/{{urlencode:{{{cf id}}}}}|{{{url|}}}}}}}}}</div>
 
   <div class="mod-url">{{#tag:nowiki|{{#if:{{{nexus id|}}}|{{nexus mod|{{{nexus id}}}}}|{{#if:{{{cf id|}}}|https://community.playstarbound.com/resources/{{urlencode:{{{cf id}}}}}|{{{url|}}}}}}}}}</div>
 
   {{#if:{{{nexus id|}}}|<div class="mod-nexus-id">{{{nexus id|}}}</div>}}
 
   {{#if:{{{nexus id|}}}|<div class="mod-nexus-id">{{{nexus id|}}}</div>}}
Line 75: Line 63:
 
   {{#if:{{{source|}}}|<div class="mod-custom-source">{{#tag:nowiki|{{{source|}}}}}</div>}}
 
   {{#if:{{{source|}}}|<div class="mod-custom-source">{{#tag:nowiki|{{{source|}}}}}</div>}}
 
   <div class="mod-status">{{#arrayindex:vars|1}}</div>
 
   <div class="mod-status">{{#arrayindex:vars|1}}</div>
  {{#if:{{{summary|}}}|<div class="mod-summary">{{{summary|}}}</div>}}
 
 
   {{#if:{{{broke in|}}}|<div class="mod-broke-in">{{{broke in|}}}</div>}}
 
   {{#if:{{{broke in|}}}|<div class="mod-broke-in">{{{broke in|}}}</div>}}
 
   {{#if:{{{unofficial version|}}}|<div class="mod-unofficial-version">{{{unofficial version|}}}</div>}}
 
   {{#if:{{{unofficial version|}}}|<div class="mod-unofficial-version">{{{unofficial version|}}}</div>}}
Line 81: Line 68:
 
{{#ifeq:{{#arrayindex:statuscompare|0}}|different|
 
{{#ifeq:{{#arrayindex:statuscompare|0}}|different|
 
   <div class="mod-beta-status">{{#arrayindex:vars|3}}</div>
 
   <div class="mod-beta-status">{{#arrayindex:vars|3}}</div>
  {{#if:{{{beta summary|}}}|<div class="mod-beta-summary">{{{beta summary|}}}</div>}}
 
 
   {{#if:{{{beta broke in|}}}|<div class="mod-beta-broke-in">{{{beta broke in|}}}</div>}}
 
   {{#if:{{{beta broke in|}}}|<div class="mod-beta-broke-in">{{{beta broke in|}}}</div>}}
 
   {{#if:{{{beta unofficial version|}}}|<div class="mod-beta-unofficial-version">{{{beta unofficial version|}}}</div>}}
 
   {{#if:{{{beta unofficial version|}}}|<div class="mod-beta-unofficial-version">{{{beta unofficial version|}}}</div>}}

Revision as of 06:11, 20 October 2018

Examples

Compatible mod

{{/entry
  |name     = Lookup Anything
  |author   = Pathoschild
  |id       = Pathoschild.LookupAnything
  |nexus id = 541
  |github   = Pathoschild/StardewMods
}}

Broken mod

{{/entry
  |name     = Lookup Anything
  |author   = Pathoschild
  |id       = Pathoschild.LookupAnything
  |nexus id = 541
  |github   = Pathoschild/StardewMods
  |summary  = 
  |broke in = Stardew Valley 1.2
}}

Unofficial update

For an unofficial update, use the broken-mod template and add these under the other fields:

  |unofficial url     = https://community.playstarbound.com/attachments/201345000
  |unofficial version = 1.18.2-unofficial.1-example

Usage

Main fields (shown above)

field purpose
name The normalised display name for the mod. Combine with name2 (see below) to add alternate names.
author The name of the author, as shown on Nexus or in its manifest.json file. Combine with author2 (see below) to add alternate names.
id The latest unique mod ID, as listed in its manifest.json 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 none to disable validation checks.
nexus id The mod's unique ID on Nexus (if any). This is the number in the mod page's URL.
github The mod's GitHub repository in the form owner/repo.
summary Specify custom notes or instructions about the mod's compatibility. Should usually be blank.
broke in The SMAPI or Stardew Valley update which broke this mod (if applicable).

Other fields

field purpose
status Whether the mod is compatible with the latest versions of Stardew Valley and SMAPI (see #Valid statuses). If not specified, it defaults to unofficial if an unofficial URL is given, else broken if broke in is specified, else ok.
unofficial url A page URL where the player can download an unofficial update, if any.
unofficial version The unofficial update's version number, if any.
old ids IDs which identify older versions of this mod.
cf id The mod's ID in the Chucklefish mod repository.
url The arbitrary mod URL, if not on Nexus or Chucklefish. Avoid if possible, since this makes crossreferencing more difficult.
source An arbitrary source code URL, if not on GitHub. Avoid if possible, since this makes crossreferencing more difficult.
name2
author2
Adds alternate mod and author names.
hide-url Use this instead of (url) 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.
links A comma-delimited list of URLs to add as superscript links. Mainly useful for linking to pull requests.
warnings Text explaining additional compatibility warnings about the mod (e.g. not compatible with Linux/Mac).

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.

field purpose
beta summary Specify custom notes or instructions about the mod's compatibility. Should usually be blank.
beta broke in The SMAPI or Stardew Valley update which broke this mod (if applicable).
beta status Whether the mod is compatible with the latest versions of Stardew Valley and SMAPI (see #Valid statuses). If not specified, it defaults to unofficial if an unofficial URL is given, else broken if broke in is specified, else ok.
beta unofficial url A page URL where the player can download an unofficial update, if any.
beta unofficial version The unofficial update's version number, if any.

Valid statuses

status description
ok The mod is compatible. This is the default and doesn't need to be specified.
Default summary: use latest version.
optional The mod is compatible, if you use an optional download on the mod page.
Default summary: use optional download.[1]
unofficial The mod is compatible using an unofficial update. There's no need to specify this; if you also set unofficial url and unofficial version, you can remove the status field.
workaround 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 unofficial url and unofficial version, you can remove the status field.
broken The mod isn't compatible. The message depends on whether the source link is set.
Default summary: broken, not updated yet or broken, not open-source.
abandoned The mod is no longer maintained by the author, and an unofficial update or continuation is unlikely. This should only be used when the author has definitively abandoned the mod (either explicitly, or by removing the mod page or downloads).
Default summary: no longer maintained.
obsolete The mod is no longer needed and should be removed.

Script

This script generates the template call when run from a Nexus or Chucklefish mod page.

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  = 
}}
`;