Difference between revisions of "Modding:Mod compatibility/entry"
Jump to navigation
Jump to search
Pathoschild (talk | contribs) (+ support for special 'none' ID, validation check, document support for multiple IDs) |
Pathoschild (talk | contribs) (+ attribute for custom URL) |
||
Line 8: | Line 8: | ||
! source | ! source | ||
! </noinclude> | ! </noinclude> | ||
− | |- class="mod" id="{{{name}}}" {{#if:{{{id|}}}|data-id="{{#ifeq:{{{id}}}|none||{{{id|}}}}}"}} {{#if:{{{nexus id|}}}|data-nexus-id="{{{nexus id|}}}"}} {{#if:{{{cf id|}}}|data-chucklefish-id="{{{cf id|}}}"}} data-status="{{{status|{{#if:{{{unofficial url|}}}|workaround|{{#if:{{{broke in|}}}|broken|ok}}}}}}}" {{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} {{#if:{{{github|}}}|data-github="{{{github}}}"}} {{#if:{{{source|}}}|data-custom-source="{{{source|}}}"}} style="line-height: 1em; {{#switch:{{{status|{{#if:{{{unofficial url|}}}|workaround|{{#if:{{{broke in|}}}|broken|ok}}}}}}} |ok|optional=background: #9F9; |workaround=background: #CF9; |broken={{#if:{{{unofficial url|}}}|background: #CF9;|background: #F99;}} |obsolete|abandoned=background: #999}}" | + | |- class="mod" id="{{{name}}}" {{#if:{{{id|}}}|data-id="{{#ifeq:{{{id}}}|none||{{{id|}}}}}"}} {{#if:{{{nexus id|}}}|data-nexus-id="{{{nexus id|}}}"}} {{#if:{{{cf id|}}}|data-chucklefish-id="{{{cf id|}}}"}} data-status="{{{status|{{#if:{{{unofficial url|}}}|workaround|{{#if:{{{broke in|}}}|broken|ok}}}}}}}" {{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} {{#if:{{{github|}}}|data-github="{{{github}}}"}} {{#if:{{{source|}}}|data-custom-source="{{{source|}}}"}} {{#if:{{{url|}}}|data-custom-url="{{{url}}}"}} style="line-height: 1em; {{#switch:{{{status|{{#if:{{{unofficial url|}}}|workaround|{{#if:{{{broke in|}}}|broken|ok}}}}}}} |ok|optional=background: #9F9; |workaround=background: #CF9; |broken={{#if:{{{unofficial url|}}}|background: #CF9;|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}}} {{{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>}} | ||
| {{{author}}}{{#if:{{{author2|}}}|<br /><small style="font-size:0.75em;">(aka {{{author2}}})</small>}} | | {{{author}}}{{#if:{{{author2|}}}|<br /><small style="font-size:0.75em;">(aka {{{author2}}})</small>}} |
Revision as of 18:14, 26 May 2018
mod name | author | compatibility | broke in | source | |
---|---|---|---|---|---|
{{{name}}} | {{{author}}} | ✓ use latest version. | closed source | ⚠ no id |
Usage
Templates
For a compatible mod:
{{/entry |name = Lookup Anything |author = Pathoschild |id = Pathoschild.LookupAnything |nexus id = 541 |github = Pathoschild/StardewMods }}
For a broken mod:
{{/entry |name = Lookup Anything |author = Pathoschild |id = Pathoschild.LookupAnything |nexus id = 541 |github = Pathoschild/StardewMods |summary = |broke in = Stardew Valley 1.2 }}
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
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 workaround if an unofficial URL is given, else broken if broke in is specified, else ok .
|
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 url
|
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. |
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] |
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 set this to broken instead. |
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 =
}}
`;