Anonyme

« Modèle:Cost » : différence entre les versions

De Inkipédia
3 548 octets ajoutés ,  6 mars 2023
m
fixing not linking to fish scales (i hate unnamed parameters for this reason)
Aucun résumé des modifications
FRInki>Exaskliri
m (fixing not linking to fish scales (i hate unnamed parameters for this reason))
Ligne 1 : Ligne 1 :
{{ImageLabel|{{#switch:{{{currency|Argent}}}
<includeonly>[[File:{{{1}}} Icon {{#switch:{{{3|{{{currency|cash}}}}}}
|sss     = Super Sea Snail.png
|pe=Power Egg{{#ifeq:{{{1}}}|S3|&#32;Alterna}}
|pe       = Power Egg.png
|sss=Super Sea Snail
|#default = Coins.png
|ge=Golden Egg
}}|{{{1|}}}
|sard=Sardinium{{#ifeq:{{{1}}}|S2|&#32;Shadow}}
|size={{{2|30px}}}|link={{#switch:{{{currency|Argent}}}
|ac=Ability Chunk Generic
|sss     = Super Sea Snail
|cqp=CQ Points
|pe      = Power Egg
|sl=Sheldon License
|#default = Cash
|gsl=Gold Sheldon License
}}
|bs=Bronze Fish Scale
|width={{{width|auto}}}
|ss=Silver Fish Scale
|align={{{align|right}}}
|gs=Gold Fish Scale
}}<noinclude>
|cash
|#default=Cash}}.png|{{#iferror:{{#expr:{{{4|24}}}}}|24}}px|{{#switch:{{{3|{{{currency|cash}}}}}}
|pe=Power Egg{{#ifeq:{{{2}}}|1||s}}
|sss=Super Sea Snail{{#ifeq:{{{2}}}|1||s}}
|ge=Golden Egg{{#ifeq:{{{2}}}|1||s}}
|sard=Sardinium
|ac=Ability Chunk{{#ifeq:{{{2}}}|1||s}}
|cqp=CQ Point{{#ifeq:{{{2}}}|1||s}}
|sl=Sheldon License{{#ifeq:{{{2}}}|1||s}}
|gsl=Gold Sheldon License{{#ifeq:{{{2}}}|1||s}}
|bs=Bronze Fish Scale{{#ifeq:{{{2}}}|1||s}}
|ss=Silver Fish Scale{{#ifeq:{{{2}}}|1||s}}
|gs=Gold Fish Scale{{#ifeq:{{{2}}}|1||s}}
|cash
|#default=Cash}}|link={{#switch:{{{3|{{{currency|cash}}}}}}
|pe=Power Egg
|sss=Super Sea Snail
|ge=Golden Egg
|sard=Sardinium
|ac=Ability chunk
|cqp=CQ-80#CQ Points
|sl
|gsl=Sheldon License
|bs
|ss
|gs=Fish scale
|cash
|#default=Cash}}]]<span style="display: inline-block; text-align: right; {{#if:{{{6|}}}|width:{{{6|}}}px}}">{{#if:{{{2|}}}|&nbsp;{{#ifeq:{{{5|{{{4|}}}}}}|link|[[{{#switch:{{{3|{{{currency|cash}}}}}}
|pe=Power Egg
|sss=Super Sea Snail
|ge=Golden Egg
|sard=Sardinium
|ac=Ability chunk
|cqp=CQ-80#CQ Points
|sl
|gsl=Sheldon License
|bs
|ss
|gs=Fish scale
|#default=Cash}}|{{{2}}}]]|{{{2}}}}}}}</span></includeonly><noinclude>__NOTOC__
Displays an inline currency icon with a text link.


;Summary
=== Usage ===
A handy template for putting the [[Cash]], [[Super Sea Snail]] or [[Power Egg]] icon next to a price.
{{t|Cost|game|price|currency|size|link|textwidth}}


; Usage
{| class="wikitable sitecolor-generic"
* {{t|cost|amount}} for a simple cost in cash.
| style="vertical-align:top" |<code>game</code>
* {{t|cost|amount|size}} makes it 24 pixels wide.
| style="vertical-align:top" |Unnamed, required
* {{t|cost|amount|currency{{=}}}} to select the currency
| colspan="4" |The game that the cost belongs to. Must be one of the following:
* {{t|cost|amount|currency{{=}}sss}} shows [[Super Sea Snail]] cost.
* <code>S</code> for ''Splatoon''
* {{t|cost|amount|currency{{=}}pe}} shows [[Power Egg]] cost.
* <code>S2</code> for ''Splatoon 2''
* <code>S3</code> for ''Splatoon 3''
|-
| style="vertical-align:top" |<code>price</code>
| style="vertical-align:top" |Unnamed, required
| colspan="4" |The number / string to show as the cost.<br />If set empty, the template will show the icon but no number.<br />Use <code>0</code> or <code>Free</code> for free items.
|-
| rowspan="14" style="vertical-align:top" |<code>currency</code>
| rowspan="14" style="vertical-align:top" |Unnamed, optional
| colspan="4" |The currency to use.<br />The default value is <code>cash</code>.
|-
|Must be one of the following:
|width="24px" | S
|width="24px" | S2
|width="24px" | S3
|-
|<code>cash</code> || {{Cost|S| |cash}} || {{Cost|S2| |cash}} || {{Cost|S3| |cash}}
|-
|<code>pe</code> || {{Cost|S| |pe}} || {{Cost|S2| |pe}} || {{Cost|S3| |pe}}
|-
|<code>sss</code> || {{Cost|S| |sss}} || {{Cost|S2| |sss}} || {{Cost|S3| |sss}}
|-
|<code>ge</code> ||  || {{Cost|S2| |ge}} || {{Cost|S3| |ge}}
|-
|<code>sard</code> ||  || {{Cost|S2| |sard}} || {{Cost|S3| |sard}}
|-
|<code>ac</code> ||  || {{Cost|S2| |ac}} ||
|-
|<code>cqp</code> ||  || {{Cost|S2| |cqp}} ||
|-
|<code>sl</code> ||  || || {{Cost|S3| |sl}}
|-
|<code>gsl</code> ||  ||  || {{Cost|S3| |gsl}}
|-
|<code>bs</code> ||  ||  || {{Cost|S3| |bs}}
|-
|<code>ss</code> ||  || || {{Cost|S3| |ss}}
|-
|<code>gs</code> ||  ||  || {{Cost|S3| |gs}}
|-
| style="vertical-align:top" |<code>size</code>
| style="vertical-align:top" |Unnamed, optional
| colspan="4" |The icon size for the currency icon. The default is <code>24</code>.
|-
| style="vertical-align:top" |<code>link</code>
| style="vertical-align:top" |Unnamed, optional
| colspan="4" |If present, the amount text will be a link to the currency's page.
|-
| style="vertical-align:top" |<code>textwidth</code>
| style="vertical-align:top" |Unnamed, optional
| colspan="4" |Requries <code>size</code> and <code>link</code> to both be present.<br />If specified, the label will be set inside a right-aligned rectangle of the specified width
|}


; Examples
=== Markup ===
* <nowiki>{{Cost|400|48px}}</nowiki> gives {{Cost|400|48px}}
<pre>
* <nowiki>{{Cost|1|24px|currency=sss}}</nowiki> gives {{Cost|1|24px|currency=sss}}
*{{Cost|S|200}}
* <nowiki>{{Cost|300|12px|currency=pe}}</nowiki> gives {{Cost|300|12px|currency=pe}}
*{{Cost|S2|200}}
*{{Cost|S3|200}}
*{{Cost|S|}}
*{{Cost|S|1|sss}}
*{{Cost|S2| |ac}}
*{{Cost|S3|160|bs}}
*{{Cost|S|200|cash|48}}
*{{Cost|S|200|cash|link}}
*{{Cost|S|200|cash|48|link}}
*{{Cost|S|200|cash|24|link|60}}
*{{Cost|S|200|cash|24| |60}}
</pre>


=== Output ===
*{{Cost|S|200}}
*{{Cost|S2|200}}
*{{Cost|S3|200}}
*{{Cost|S|}}
*{{Cost|S|1|sss}}
*{{Cost|S2| |ac}}
*{{Cost|S3|160|bs}}
*{{Cost|S|200|cash|48}}
*{{Cost|S|200|cash|link}}
*{{Cost|S|200|cash|48|link}}
*{{Cost|S|200|cash|24|link|60}}
*{{Cost|S|200|cash|24| |60}}
[[Category:Templates]]
</noinclude>
</noinclude>
Utilisateur anonyme