Difference between revisions of "Template:Quality"

From Stardew Valley Wiki
Jump to navigation Jump to search
(remove link and alt parameters, as this template was never intended to link to images)
Line 15: Line 15:
 
-->{{#iferror:{{#expr:{{#arrayprint:$qsize}}<24}}|{{#arraydefine:$qsize|48}}|}}<!--
 
-->{{#iferror:{{#expr:{{#arrayprint:$qsize}}<24}}|{{#arraydefine:$qsize|48}}|}}<!--
 
--><div id="{{#ifexpr:{{#arrayprint:$qsize}}<28|qualitycontainersm|{{#ifexpr:{{#arrayprint:$qsize}}<40|qualitycontainermed|qualitycontainer}}}}"><!--
 
--><div id="{{#ifexpr:{{#arrayprint:$qsize}}<28|qualitycontainersm|{{#ifexpr:{{#arrayprint:$qsize}}<40|qualitycontainermed|qualitycontainer}}}}"><!--
   --><div id="qualityimage">[[File:{{#arrayprint:$qimage}}.png| {{#arrayprint:$qsize}}px |link={{#ifeq:{{{link}}}|||{{{link|{{{1|}}}}}}}} |alt={{#ifeq:{{{alt}}}|||{{{alt|{{{link|{{{1|}}}}}}}}}}}]]<!--
+
   --><div id="qualityimage">[[File:{{#arrayprint:$qimage}}.png| {{#arrayprint:$qsize}}px |link=|alt=]]<!--
 
     --><div class="qualityindicator"><!--
 
     --><div class="qualityindicator"><!--
       -->{{#switch:{{#arrayindex:$qquality|0}}|Silver|Gold|Iridium=[[File:{{#arrayindex:$qquality|0}}_Quality_Icon.png| {{#arrayprint:$qsize}}px |link={{#ifeq:{{{link}}}|||{{{link|{{{1|}}}}}}}} |alt={{#arrayindex:$qquality|0}}]]}}<!--
+
       -->{{#switch:{{#arrayindex:$qquality|0}}|Silver|Gold|Iridium=[[File:{{#arrayindex:$qquality|0}}_Quality_Icon.png| {{#arrayprint:$qsize}}px |link=|alt=]]}}<!--
 
--></div></div></div></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>
 
--></div></div></div></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>

Revision as of 17:40, 9 May 2021

Description

This template overlays a quality star icon (silver, gold, or iridium) over an image.

Parameters

Parameter Notes
First (unnamed) parameter Name of background image (without extension such as .png)
Second (unnamed) parameter Quality star to display
Valid values: normal, 0, silver, 1, gold, 2, iridium, 4
Third (unnamed) parameter Desired display width of background image (do not include "px")
Valid values: 48, 36, 32, 24 (other values will be accepted, but may produce undesired results)
Default value: 24
Fourth (unnamed) parameter center, if the image is to be displayed in a table cell. Adding this parameter will center the image in the cell.

Examples

Template Call Result
{{Quality|Parsnip|iridium}}
{{Quality|Parsnip|silver|24|center}}
{{Quality|Sunfish|normal|36}}
{{Quality|Red Plate|gold|36|center}}
{{Quality|Beer|gold|48}}
{{Quality|Large Goat Milk ES|gold|32|center}}