Difference between revisions of "Template:Qualityprice/doc"
Margotbean (talk | contribs) |
Margotbean (talk | contribs) |
||
Line 1: | Line 1: | ||
+ | {{Construction}} | ||
[[Template:Qualityprice|Qualityprice]] displays a table of the sell prices for a requested item for all item qualities. Each sell price is shown with the image icon and a superimposed quality star (see [[Template:Quality]]). It intentionally does not show the money icon so as to not clutter the page with multiple icons. | [[Template:Qualityprice|Qualityprice]] displays a table of the sell prices for a requested item for all item qualities. Each sell price is shown with the image icon and a superimposed quality star (see [[Template:Quality]]). It intentionally does not show the money icon so as to not clutter the page with multiple icons. | ||
− | In order for the values to be calculated correctly, the input value should always be the item base cost. If other factors should be included (''e.g.,'' professions that increase the price), those factors should be specified using the <samp> | + | In order for the values to be calculated correctly, the input value should always be the item base cost. If other factors should be included (''e.g.,'' professions that increase the price), those factors should be specified using the <samp>pm</samp> parameter. |
− | For variable price items (Wine, Juice, Pickles, Jelly | + | For variable price items (Wine, Juice, Pickles, Jelly, Honey), this template also allows the item base price to be automatically calculated from the source item price. |
Additionally, a sortkey is provided allowing correct sorting in tables where a column contains multiple instances of this template. | Additionally, a sortkey is provided allowing correct sorting in tables where a column contains multiple instances of this template. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Use== | ==Use== | ||
Line 24: | Line 16: | ||
<nowiki>{{</nowiki>[[Template:Qualityprice|Qualityprice]] |''item_name''| ''base_cost'' | prof_mult=''mult'' | quality=''values'' | <nowiki>{{</nowiki>[[Template:Qualityprice|Qualityprice]] |''item_name''| ''base_cost'' | prof_mult=''mult'' | quality=''values'' | ||
− | + | | hide=''values'' | sortkey=''value'' <nowiki>}}</nowiki> | |
− | |||
===Parameters=== | ===Parameters=== | ||
There are two unnamed, required parameters, ''item_name'' and ''base_cost''. All other parameters are named and optional. Default value for all arguments is empty, unless specified otherwise. | There are two unnamed, required parameters, ''item_name'' and ''base_cost''. All other parameters are named and optional. Default value for all arguments is empty, unless specified otherwise. | ||
− | |||
− | |||
* '''''item_name''''' | * '''''item_name''''' | ||
** First unnamed parameter, required. | ** First unnamed parameter, required. | ||
− | ** Name of item being displayed. There should be a corresponding image named <samp>File: | + | ** Name of item being displayed. There should be a corresponding image named <samp>File:item name.png</samp>. |
− | ** On non-english wikis this should | + | ** On non-english wikis this should be the '''English''' item name. |
− | |||
* '''''base_cost''''' | * '''''base_cost''''' | ||
** Second unnamed parameter. | ** Second unnamed parameter. | ||
− | ** Required unless <samp>srcprice</samp> and <samp>auto</samp> are specified AND the item is one whose price can be auto-calculated. | + | ** Required unless <samp>srcprice</samp> and <samp>auto</samp> are specified AND the item is one whose price can be auto-calculated. |
** The base cost of the displayed item. | ** The base cost of the displayed item. | ||
** Normally the base cost should be a numeric value (or valid numeric expression). If a non-numeric cost is provided, it will be printed as-is for all requested qualities (and the sortkey is set to "0" to hide the non-numeric data from any table-sorting). | ** Normally the base cost should be a numeric value (or valid numeric expression). If a non-numeric cost is provided, it will be printed as-is for all requested qualities (and the sortkey is set to "0" to hide the non-numeric data from any table-sorting). | ||
Line 48: | Line 36: | ||
** This value is always ignored (<samp>prof_mult</samp> is forced to be 1) for Oil and Coffee, to ensure that the Artisan Profession bonus is not accidentally displayed for these items. This allows oil to be shown in multi-item infobox displays alongside other artisan goods without any special handling elsewhere. | ** This value is always ignored (<samp>prof_mult</samp> is forced to be 1) for Oil and Coffee, to ensure that the Artisan Profession bonus is not accidentally displayed for these items. This allows oil to be shown in multi-item infobox displays alongside other artisan goods without any special handling elsewhere. | ||
− | * '''quality='' | + | * '''quality=''value''''' |
− | ** | + | ** Quality value to display. Default value is all 4 qualities |
− | |||
− | |||
− | |||
− | |||
− | |||
* '''srcprice=''price''''' | * '''srcprice=''price''''' | ||
** The base price of the source item (''e.g.,'' vegetable, fruit, flower, or fish) used to create the displayed item. | ** The base price of the source item (''e.g.,'' vegetable, fruit, flower, or fish) used to create the displayed item. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* '''hide=''values''''' | * '''hide=''values''''' | ||
** List of quality values to hide, as a comma-separated list of individual values. | ** List of quality values to hide, as a comma-separated list of individual values. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Examples=== | ===Examples=== | ||
Line 98: | Line 62: | ||
<pre> | <pre> | ||
− | {{Qualityprice|Apple|42|iridium|hide=gold,silver | + | {{Qualityprice|Apple|42|iridium|hide=gold,silver}} |
</pre> | </pre> | ||
− | {{Qualityprice|Apple|42|iridium|hide=gold,silver | + | {{Qualityprice|Apple|42|iridium|hide=gold,silver}} |
<pre> | <pre> | ||
Line 111: | Line 75: | ||
</pre> | </pre> | ||
{{Qualityprice|Wine|auto=true|srcprice=42|prof_mult=1.4}} | {{Qualityprice|Wine|auto=true|srcprice=42|prof_mult=1.4}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<includeonly>{{Addlanglinks}}[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude> | <includeonly>{{Addlanglinks}}[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude> |
Revision as of 03:23, 20 February 2023
Under Construction This article or section is under construction. It may be in the process of an expansion or major restructuring. Last edited by Margotbean on 2023-02-20 03:23:56. |
Qualityprice displays a table of the sell prices for a requested item for all item qualities. Each sell price is shown with the image icon and a superimposed quality star (see Template:Quality). It intentionally does not show the money icon so as to not clutter the page with multiple icons.
In order for the values to be calculated correctly, the input value should always be the item base cost. If other factors should be included (e.g., professions that increase the price), those factors should be specified using the pm parameter.
For variable price items (Wine, Juice, Pickles, Jelly, Honey), this template also allows the item base price to be automatically calculated from the source item price.
Additionally, a sortkey is provided allowing correct sorting in tables where a column contains multiple instances of this template.
Use
Syntax
Basic usage:
{{Qualityprice |item_name| base_cost }}
Complete argument list:
{{Qualityprice |item_name| base_cost | prof_mult=mult | quality=values | hide=values | sortkey=value }}
Parameters
There are two unnamed, required parameters, item_name and base_cost. All other parameters are named and optional. Default value for all arguments is empty, unless specified otherwise.
- item_name
- First unnamed parameter, required.
- Name of item being displayed. There should be a corresponding image named File:item name.png.
- On non-english wikis this should be the English item name.
- base_cost
- Second unnamed parameter.
- Required unless srcprice and auto are specified AND the item is one whose price can be auto-calculated.
- The base cost of the displayed item.
- Normally the base cost should be a numeric value (or valid numeric expression). If a non-numeric cost is provided, it will be printed as-is for all requested qualities (and the sortkey is set to "0" to hide the non-numeric data from any table-sorting).
- prof_mult=mult
- Any other multipliers (e.g., profession price bonuses) that should be included in the calculated price. Default value is 1.
- This value is always ignored (prof_mult is forced to be 1) for Oil and Coffee, to ensure that the Artisan Profession bonus is not accidentally displayed for these items. This allows oil to be shown in multi-item infobox displays alongside other artisan goods without any special handling elsewhere.
- quality=value
- Quality value to display. Default value is all 4 qualities
- srcprice=price
- The base price of the source item (e.g., vegetable, fruit, flower, or fish) used to create the displayed item.
- hide=values
- List of quality values to hide, as a comma-separated list of individual values.
Examples
{{Qualityprice|Pumpkin|100}}
100g | |
125g | |
150g | |
200g |
{{Qualityprice|Pumpkin|100|prof_mult=1.1}}
100g | |
125g | |
150g | |
200g |
{{Qualityprice|Leek|60|iridium}}
60g | |
75g | |
90g | |
120g |
{{Qualityprice|Apple|42|iridium|hide=gold,silver}}
42g | |
84g |
{{Qualityprice|Apple|42|iridium|hide=silver,iridium}}
42g | |
63g |
{{Qualityprice|Wine|auto=true|srcprice=42|prof_mult=1.4}}
0 | |
0 | |
0 | |
0 |