Jump to content

Template:Qualityprice: Difference between revisions

From Stardew Valley Wiki
imported>Nebulous Maestress
m Change how formatting is done for sake of template portability
imported>Nebulous Maestress
m sortkey tweaks for the umpteenth time... known issues fixed
Line 55: Line 55:
           |{{#ifeq:{{{link|}}}|1||{{{link|{{#ifeq:{{CONTENTLANG}}|en|{{{1|}}}}}}}}}}}}}}}}<!--
           |{{#ifeq:{{{link|}}}|1||{{{link|{{#ifeq:{{CONTENTLANG}}|en|{{{1|}}}}}}}}}}}}}}}}<!--
// Display sort key (0 for text/non-numeric price so it doesn't mess up table)
// Display sort key (0 for text/non-numeric price so it doesn't mess up table)
--><span class="sortkey" style="display:none;">{{#iferror:
--><span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true
    {{#expr:{{#arrayprint:$qpprice}}>0}}
    |{{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}}
         |0
         |0
         |{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}}}</span><!--
         |{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}}}
    |{{{sortkey}}}}}}}"><!--
// Start table and loop through each requested quality
// Start table and loop through each requested quality
// Display icon using Quality template and calculate/display price-->
// Display icon using Quality template and calculate/display price-->
Line 73: Line 74:
         }}}}{{#arrayprint:$lang_qp_gold}}
         }}}}{{#arrayprint:$lang_qp_gold}}
}}}}
}}}}
{{!}}}<!--
{{!}}}</span><!--
--></includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
--></includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
{{{{FULLPAGENAME}}/doc}} }}</noinclude>
{{{{FULLPAGENAME}}/doc}} }}</noinclude>

Revision as of 19:41, 27 October 2020

Description

This template displays prices for items of specified qualities, formatted appropriately for the language where they appear. The image of the item is included (with any quality stars) instead of the gold icon. The size of the image is always 24px.

Parameters

Parameter Notes
First (unnamed) parameter Name of image (minus ".png")
Second (unnamed) parameter Normal/base sell price of item (can be found in ObjectInformation.xnb)
or
Normal/base sell price of item used to make Artisan Good (see examples below)
Note: also accepts non-numbers such as "3x base fruit price" without throwing an error
quality Single quality to display.
Defaults to all qualities (normal, silver, gold, iridium) if omitted.
Items that exist in normal quality only do not have to specify quality=normal (i.e., Cave Carrot, Ginger, Green Tea, Honey, Jelly, Juice, Oil, Pickles, Qi Fruit, and Tea Leaves)
Note: Other items may be added in the future. In the meantime, specifying quality=normal or quality=0 will work.
hide Qualities to hide
(e.g., hide=silver,gold)
pm Profession modifier
Tiller gives a 10% bonus, so specify pm=1.1
Angler gives a 50% bonus, so specify pm=1.5
etc.
dsv data-sort-value
Set to false if the quality price(s) are displayed in a non-sortable structure (like an infobox)
Default value is true (the entire parameter can be omitted if a data-sort-value is desired).

Examples

Template Call Result
{{Qualityprice|Melon|250}} Template:ParseInputValues
250g
{{Qualityprice|Parsnip|35|pm=1.1}} Template:ParseInputValues
35g
{{Qualityprice|Ginger|60}} Template:ParseInputValues
60g
{{Qualityprice|Goat Cheese|400|hide=normal,silver}} Template:ParseInputValues
400g
{{Qualityprice|Large Goat Milk FR|345}} Template:ParseInputValues
345g
{{Qualityprice|Juice|260}}
(The base sell price of Red Cabbage is 260,
and the base sell price of Red Cabbage Juice is 585)
Template:ParseInputValues
260g
{{Qualityprice|Purple Juice|260|quality=0}}
(Must specify quality=normal or
quality=0 if using a colored sprite)
Template:ParseInputValues
260g
{{Qualityprice|Wine|750|pm=1.4}}
(The base sell price of Starfruit is 750,
and the Artisan base sell price of Starfruit Wine is 3,150)
Template:ParseInputValues
750g
{{Qualityprice|Honey|30}}
(The base sell price of a Tulip is 30,
and the base sell price of Tulip Honey is 160)
Template:ParseInputValues
30g