Line 10: |
Line 10: |
| </noinclude><!-- | | </noinclude><!-- |
| | | |
− | Define a few expensive variables here. | + | Define a few variables here: |
| + | {{#arrayindex:has_source|0}} = set if a GitHub project name or custom source URL is set, else blank |
| + | {{#arrayindex:status|0}} = compatibility status for the stable SMAPI/SDV release |
| + | {{#arrayindex:beta_status|0}} = compatibility status for the beta SMAPI/SDV release |
| + | {{#arrayindex:status_compare|0}} = whether the compatibility info is equivalent between main and beta ('same' or 'different'). If both statuses are 'unofficial', they match if their unofficial URLs do; else they match if their statuses do. |
| | | |
− | {{#arrayindex:sourceUrl|0}} = GitHub URL, else custom source URL
| + | -->{{#arraydefine:has_source|{{#if:{{{github|}}}{{{source|}}}|1}}}}<!-- |
− | {{#arrayindex:status|0}} = main status
| |
− | {{#arrayindex:status|1}} = beta status
| |
− | {{#arrayindex:statuscompare|0}} = whether the compatibility info is equivalent between main and beta ('same' or 'different'). If both statuses are 'unofficial', they match if their unofficial URLs do; else they match if their statuses do.
| |
| | | |
− | -->{{#arraydefine:sourceUrl|{{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}}}<!-- | + | -->{{#arraydefine:status|{{#if:{{{status|}}} |
− | -->{{#arraydefine:status|<!--
| + | |{{{status}}} |
− | 0-->{{Modding:Mod compatibility/entry/status|source={{#arrayindex:sourceUrl|0}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}}},<!--
| + | |{{#if:{{{unofficial url|}}} |
− | 1-->{{Modding:Mod compatibility/entry/status|source={{#arrayindex:sourceUrl|0}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|beta unofficial={{{beta unofficial url|}}}|beta broke in={{{beta broke in|}}}|beta status={{{beta status|}}}}}
| + | |unofficial |
− | }}{{#arraydefine:statuscompare|{{#switch:{{#arrayindex:status|0}},{{#arrayindex:status|1}} | + | |{{#if:{{{broke in|}}} |
| + | |broken |
| + | |ok |
| + | }} |
| + | }} |
| + | }}}}<!-- |
| + | |
| + | -->{{#arraydefine:beta_status|{{#if:{{{beta status|}}} |
| + | |{{{beta status}}} |
| + | |{{#if:{{{beta unofficial url|}}} |
| + | |unofficial |
| + | |{{#if:{{{beta broke in|}}} |
| + | |broken |
| + | |{{#arrayindex:status|0}} |
| + | }} |
| + | }} |
| + | }}}}<!-- |
| + | |
| + | -->{{#arraydefine:status_compare|{{#switch:{{#arrayindex:status|0}},{{#arrayindex:beta_status|0}} |
| |unofficial,unofficial = {{#ifeq:{{{unofficial url|}}}|{{#if:{{{beta unofficial url|}}}|{{{beta unofficial url}}}|{{{unofficial url|}}}}}|same|different}} | | |unofficial,unofficial = {{#ifeq:{{{unofficial url|}}}|{{#if:{{{beta unofficial url|}}}|{{{beta unofficial url}}}|{{{unofficial url|}}}}}|same|different}} |
− | |#default = {{#ifeq:{{#arrayindex:status|0}}|{{#arrayindex:status|1}}|same|different}} | + | |#default = {{#ifeq:{{#arrayindex:status|0}}|{{#arrayindex:beta_status|0}}|same|different}} |
| }}}}<!-- | | }}}}<!-- |
| | | |
Line 51: |
Line 70: |
| -->{{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} <!-- | | -->{{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} <!-- |
| -->{{#if:{{{unofficial url|}}}|data-unofficial-url="{{#tag:nowiki|{{{unofficial url}}}}}"}} <!-- | | -->{{#if:{{{unofficial url|}}}|data-unofficial-url="{{#tag:nowiki|{{{unofficial url}}}}}"}} <!-- |
− | -->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<!-- | + | -->{{#ifeq:{{#arrayindex:status_compare|0}}|different|<!-- |
− | -->data-beta-status="{{#arrayindex:status|1}}" <!-- | + | -->data-beta-status="{{#arrayindex:beta_status|0}}" <!-- |
| -->{{#if:{{{beta broke in|}}}|data-beta-broke-in="{{{beta broke in}}}"}} <!-- | | -->{{#if:{{{beta broke in|}}}|data-beta-broke-in="{{{beta broke in}}}"}} <!-- |
| -->{{#if:{{{beta unofficial version|}}}|data-beta-unofficial-version="{{{beta unofficial version}}}"}} <!-- | | -->{{#if:{{{beta unofficial version|}}}|data-beta-unofficial-version="{{{beta unofficial version}}}"}} <!-- |
Line 64: |
Line 83: |
| |<!-- | | |<!-- |
| | | |
− | stable label (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|'''{{version|stable|link=0}}:''' }}<!-- | + | stable label (if different)-->{{#ifeq:{{#arrayindex:status_compare|0}}|different|'''{{version|stable|link=0}}:''' }}<!-- |
| | | |
| summary--><span class="mod-summary">{{#switch:{{#arrayindex:status|0}} | | summary--><span class="mod-summary">{{#switch:{{#arrayindex:status|0}} |
Line 71: |
Line 90: |
| |unofficial = ⚠ broken{{#if:{{{unofficial url|}}}|, use [{{{unofficial url}}} unofficial update]{{#if:{{{unofficial version|}}}| (<small>{{{unofficial version}}}</small>)}}|{{{unofficial url}}}}}. | | |unofficial = ⚠ broken{{#if:{{{unofficial url|}}}|, use [{{{unofficial url}}} unofficial update]{{#if:{{{unofficial version|}}}| (<small>{{{unofficial version}}}</small>)}}|{{{unofficial url}}}}}. |
| |workaround = ⚠ broken, {{{summary}}} | | |workaround = ⚠ broken, {{{summary}}} |
− | |broken = ↻ broken, {{#if:{{{summary|}}}|{{{summary}}}|{{#if:{{#arrayindex:sourceUrl|0}}|not updated yet.|not open-source.}}}} | + | |broken = ↻ broken, {{#if:{{{summary|}}}|{{{summary}}}|{{#if:{{#arrayindex:has_source|0}}|not updated yet.|not open-source.}}}} |
| |obsolete = ✖ {{#if:{{{summary|}}}|{{{summary}}}|remove this mod (obsolete).}} | | |obsolete = ✖ {{#if:{{{summary|}}}|{{{summary}}}|remove this mod (obsolete).}} |
| |abandoned = ✖ {{#if:{{{summary|}}}|{{{summary}}}|remove this mod (no longer maintained).}} | | |abandoned = ✖ {{#if:{{{summary|}}}|{{{summary}}}|remove this mod (no longer maintained).}} |
| }}</span>{{#ifeq:{{#arrayindex:status|0}}|optional|<ref name="optional-update" />}}<!-- | | }}</span>{{#ifeq:{{#arrayindex:status|0}}|optional|<ref name="optional-update" />}}<!-- |
| | | |
− | beta summary (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<br />'''1.4 (upcoming)<!--{{version|beta|link=0}}-beta-->:''' <span class="mod-beta-summary">{{#switch:{{#arrayindex:status|1}} | + | beta summary (if different)-->{{#ifeq:{{#arrayindex:status_compare|0}}|different|<br />'''1.4 (upcoming)<!--{{version|beta|link=0}}-beta-->:''' <span class="mod-beta-summary">{{#switch:{{#arrayindex:beta_status|0}} |
| |ok = ✓ {{#if:{{{beta summary|}}}|{{{beta summary}}}|use latest version.}} | | |ok = ✓ {{#if:{{{beta summary|}}}|{{{beta summary}}}|use latest version.}} |
| |optional = ✓ {{#if:{{{beta summary|}}}|{{{beta summary}}}|use optional download.}} | | |optional = ✓ {{#if:{{{beta summary|}}}|{{{beta summary}}}|use optional download.}} |
| |unofficial = ⚠ broken{{#if:{{{beta unofficial url|}}}|, use [{{{beta unofficial url}}} unofficial update]{{#if:{{{beta unofficial version|}}}| (<small>{{{beta unofficial version}}}</small>)}}|{{{beta unofficial url}}}}}. | | |unofficial = ⚠ broken{{#if:{{{beta unofficial url|}}}|, use [{{{beta unofficial url}}} unofficial update]{{#if:{{{beta unofficial version|}}}| (<small>{{{beta unofficial version}}}</small>)}}|{{{beta unofficial url}}}}}. |
| |workaround = ⚠ broken, {{{beta summary}}} | | |workaround = ⚠ broken, {{{beta summary}}} |
− | |broken = ↻ broken, {{#if:{{{beta summary|}}}|{{{beta summary}}}|{{#if:{{#arrayindex:sourceUrl|0}}|not updated yet.|not open-source.}}}} | + | |broken = ↻ broken, {{#if:{{{beta summary|}}}|{{{beta summary}}}|{{#if:{{#arrayindex:has_source|0}}|not updated yet.|not open-source.}}}} |
| |obsolete = ✖ {{#if:{{{beta summary|}}}|{{{beta summary}}}|remove this mod (obsolete).}} | | |obsolete = ✖ {{#if:{{{beta summary|}}}|{{{beta summary}}}|remove this mod (obsolete).}} |
| |abandoned = ✖ {{#if:{{{beta summary|}}}|{{{beta summary}}}|remove this mod (no longer maintained).}} | | |abandoned = ✖ {{#if:{{{beta summary|}}}|{{{beta summary}}}|remove this mod (no longer maintained).}} |
− | }}</span>{{#ifeq:{{#arrayindex:status|1}}|optional|<ref name="optional-update" />}}}}<!-- | + | }}</span>{{#ifeq:{{#arrayindex:beta_status|0}}|optional|<ref name="optional-update" />}}}}<!-- |
| | | |
| warnings-->{{#if:{{{warnings|}}}|<br />⚠ {{#arrayprint:warnings|<br />⚠ }}}} | | warnings-->{{#if:{{{warnings|}}}|<br />⚠ {{#arrayprint:warnings|<br />⚠ }}}} |
Line 92: |
Line 111: |
| | | |
| anchor-->[[#{{#arrayindex:names|0}}|#]] <!-- | | anchor-->[[#{{#arrayindex:names|0}}|#]] <!-- |
− | metadata links-->{{#if:{{{link labels|}}}|{{#arraydefine:labelsArray|{{{link labels}}}}}}}{{#if:{{{links|}}}| {{#arraydefine:linkArray|{{{links}}}}}{{#arrayprint:linkArray| |@@@|[@@@ {{#if:{{#arrayindex:labelsArray|{{#arraysearch:linkArray|@@@}}}}|{{#arrayindex:labelsArray|{{#arraysearch:linkArray|@@@}}}}|{{#expr:{{#arraysearch:linkArray|@@@}} + 1}}}}]}}}} <!-- | + | metadata links-->{{#if:{{{link labels|}}}|{{#arraydefine:labels_array|{{{link labels}}}}}}}{{#if:{{{links|}}}| {{#arraydefine:linkArray|{{{links}}}}}{{#arrayprint:linkArray| |@@@|[@@@ {{#if:{{#arrayindex:labels_array|{{#arraysearch:linkArray|@@@}}}}|{{#arrayindex:labels_array|{{#arraysearch:linkArray|@@@}}}}|{{#expr:{{#arraysearch:linkArray|@@@}} + 1}}}}]}}}} <!-- |
| developer note-->{{#if:{{{dev note|}}}|<abbr title="{{{dev note|}}}">[dev note]</abbr>}}</small><noinclude> | | developer note-->{{#if:{{{dev note|}}}|<abbr title="{{{dev note|}}}">[dev note]</abbr>}}</small><noinclude> |
| |} | | |} |