Difference between revisions of "User:Becasita/SubPages/Templates/ProcessRarities"
< User:Becasita | SubPages | Templates
m (Fallback to Common.) |
(Updating links.) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ #arraydefine: @RARITIES | | + | {{ #arraydefine: @RARITIES | {{ #if: {{{1|}}} | {{{1}}} | Common }} | , }}{{ |
− | + | #arrayprint: @RARITIES | |
− | + | | {{ #switch: {{ lc: {{{space|}}} }} | left | both = <nowiki/> }} {{ | |
− | }}{{ # | + | #if: {{{2|}}} | {{{2}}} | <br /> }} {{ |
− | }}{{ # | + | #switch: {{ lc: {{{space|}}} }} | right | both = <nowiki/> }} |
− | }}{{ #if: {{ # | + | | @RARITIES-PART |
− | }}{{ # | + | | {{ #vardefine: $RARITY | {{r|@RARITIES-PART|full=yes}} }}{{ #if: {{ #var: $RARITY }} | {{ #vardefine: $RARITY-ABBR | {{ #if: {{{abbr|}}} | {{r|@RARITIES-PART}} }} }} {{ |
+ | #switch: {{ lc: {{{link|}}} }} | ||
+ | | no | none | off | false | 0 = {{ #var: $RARITY-ABBR | {{ #var: $RARITY }} }} | ||
+ | | #default = [[{{ #var: $RARITY }}|{{ #var: $RARITY-ABBR | {{ #var: $RARITY }} }}]] | ||
+ | }} }} | ||
+ | }}<noinclude> | ||
==Usage== | ==Usage== | ||
− | {{tlx|:User:Becasita/SubPages/Templates | + | {{tlx|:User:Becasita/SubPages/Templates/ProcessRarities|''<Rarities>''|''<Separator>''|abbr|space|link}} |
− | Receives one parameter | + | Receives a list of rarities. By default, it will print them with their full terminology, linked, one in each line. |
− | + | ||
+ | ;Receives two unnamed parameter: | ||
+ | :'''1''': A list of rarities separated by a comma (<code>,</code>). Not case sensitive (see {{Tn|R}} for more info). Defaults to <code>[[Common]]</code>. | ||
+ | :'''2''': A separator. In case there are two or more rarities, they will be outputted separated by the argument given to this parameter. Optional parameter. | ||
+ | |||
+ | ;Receives three named parameters: | ||
+ | :'''abbr''': By default, the rarities are outputted with their full terminology (e.g., <code>[[Super Rare]]</code>); If this parameter is filled (with, for instance <code>1</code> or <code>yes</code>), the rarities will be outputted abbreviated (e.g., <code>[[SR]]</code>). Optional parameter. | ||
+ | :'''space''': By default, there will be no spaces around the delimiter; This optional parameter serves to add said space. There are three possible keywords for this parameter: | ||
+ | :*<code>left</code>, which will add a space at the left of the delimiter; | ||
+ | :*<code>right</code>, which will add a space at the right of the delimiter; | ||
+ | :*<code>both</code>, which will add a space at both the left and the right of the delimiter. | ||
+ | :'''link''': If set to <code>no</code> / <code>none</code> / <code>off</code> / <code>false</code> / <code>0</code>, the rarities will not be linked when outputted. Optional. | ||
+ | |||
+ | ===Examples=== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! scope="row" | Input | ||
+ | | <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities|C, r, sCR, utr}}</nowiki> | ||
+ | |- | ||
+ | ! scope="row" | Output | ||
+ | | {{:User:Becasita/SubPages/Templates/ProcessRarities|C, r, sCR, utr}} | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! scope="row" | Input | ||
+ | | <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| UPR, DNPR | / | space=both }}</nowiki> | ||
+ | |- | ||
+ | ! scope="row" | Output | ||
+ | | {{:User:Becasita/SubPages/Templates/ProcessRarities| UPR , DNPR | / | space=both }} | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! scope="row" | Input | ||
+ | | <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| GScR, SP | , | space=right }}</nowiki> | ||
+ | |- | ||
+ | ! scope="row" | Output | ||
+ | | {{:User:Becasita/SubPages/Templates/ProcessRarities| GScR, SP | , | space=right }} | ||
+ | |- | ||
+ | |} | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! scope="row" | Input | ! scope="row" | Input | ||
− | | {{ | + | | <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| Normal Rare, Not a rarity, PlScR | ;<br /> | abbr=yes }}</nowiki> |
|- | |- | ||
! scope="row" | Output | ! scope="row" | Output | ||
− | | {{:User:Becasita/SubPages/Templates | + | | {{:User:Becasita/SubPages/Templates/ProcessRarities| Normal Rare, Not a rarity, PlScR | ;<br /> | abbr=yes }} |
|- | |- | ||
|} | |} | ||
− | </noinclude> | + | {| class="wikitable" |
+ | |- | ||
+ | ! scope="row" | Input | ||
+ | | <nowiki>{{:User:Becasita/SubPages/Templates/ProcessRarities| C, SP, SSP | or | space=both | link = none }}</nowiki> | ||
+ | |- | ||
+ | ! scope="row" | Output | ||
+ | | {{:User:Becasita/SubPages/Templates/ProcessRarities| C, SP, SSP | or | space=both | link = none }} | ||
+ | |- | ||
+ | |}</noinclude> |
Latest revision as of 19:35, 17 October 2016
Usage[edit]
{{User:Becasita/SubPages/Templates/ProcessRarities|<Rarities>|<Separator>|abbr|space|link}}
Receives a list of rarities. By default, it will print them with their full terminology, linked, one in each line.
- Receives two unnamed parameter
- 1: A list of rarities separated by a comma (
,
). Not case sensitive (see {{R}} for more info). Defaults toCommon
. - 2: A separator. In case there are two or more rarities, they will be outputted separated by the argument given to this parameter. Optional parameter.
- Receives three named parameters
- abbr: By default, the rarities are outputted with their full terminology (e.g.,
Super Rare
); If this parameter is filled (with, for instance1
oryes
), the rarities will be outputted abbreviated (e.g.,SR
). Optional parameter. - space: By default, there will be no spaces around the delimiter; This optional parameter serves to add said space. There are three possible keywords for this parameter:
left
, which will add a space at the left of the delimiter;right
, which will add a space at the right of the delimiter;both
, which will add a space at both the left and the right of the delimiter.
- link: If set to
no
/none
/off
/false
/0
, the rarities will not be linked when outputted. Optional.
Examples[edit]
Input | {{:User:Becasita/SubPages/Templates/ProcessRarities|C, r, sCR, utr}} |
---|---|
Output | [[[2]|[2]]] [[[3]|[3]]] [[[4]|[4]]] [[[5]|[5]]] |
Input | {{:User:Becasita/SubPages/Templates/ProcessRarities| UPR, DNPR | / | space=both }} |
---|---|
Output | [[[6]|[6]]] / [[[7]|[7]]] |
Input | {{:User:Becasita/SubPages/Templates/ProcessRarities| GScR, SP | , | space=right }} |
---|---|
Output | [[[8]|[8]]], [[[9]|[9]]] |
Input | {{:User:Becasita/SubPages/Templates/ProcessRarities| Normal Rare, Not a rarity, PlScR | ;<br /> | abbr=yes }} |
---|---|
Output | [[[10]|[10]]]; [[[11]|[11]]]; [[[12]|[12]]] |
Input | {{:User:Becasita/SubPages/Templates/ProcessRarities| C, SP, SSP | or | space=both | link = none }} |
---|---|
Output | [2] or [9] or [13] |
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedCommon
- ↑ a b Cite error: Invalid
<ref>
tag; no text was provided for refs namedC
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedr
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedsCR
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedutr
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedUPR
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedDNPR
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedGScR
- ↑ a b Cite error: Invalid
<ref>
tag; no text was provided for refs namedSP
- ↑ a b Cite error: Invalid
<ref>
tag; no text was provided for refs namedNormal Rare
- ↑ a b Cite error: Invalid
<ref>
tag; no text was provided for refs namedNot a rarity
- ↑ a b Cite error: Invalid
<ref>
tag; no text was provided for refs namedPlScR
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedSSP