From Brotato Wiki

(fix not using lowercase in switch)
(Add support for passing the character name (mainly done so we can show a working preview))
Line 1: Line 1:
== Unlocks ==
<includeonly><onlyinclude>== Unlocks ==
Unlocks [[{{Character Data|{{PAGENAME}}|unlocks}}]] if you win a game with {{PAGENAME}}:<br>
Unlocks [[{{Character Data|{{{1|{{PAGENAME}}}}}|unlocks}}]] if you win a game with {{{1|{{PAGENAME}}}}}:<br>
<!-- Item or weapon -->
<!-- Item or weapon -->
{{#switch: {{lc:{{Character Data|{{PAGENAME}}|unlocktype}}}}
{{#switch: {{lc:{{Character Data|{{{1|{{PAGENAME}}}}}|unlocktype}}}}
  | item    = {{Iconbox|{{Character Data|{{PAGENAME}}|unlocks}}|rarity={{Item Data|{{Character Data|{{PAGENAME}}|unlocks}}|rarity}}}}
  | item    = {{Iconbox|{{Character Data|{{{1|{{PAGENAME}}}}}|unlocks}}|rarity={{Item Data|{{Character Data|{{{1|{{PAGENAME}}}}}|unlocks}}|rarity}}}}
  | weapon  = {{Iconbox|{{Character Data|{{PAGENAME}}|unlocks}}|rarity={{Weapon Data|{{Character Data|{{PAGENAME}}|unlocks}}|rarity}}}}
  | weapon  = {{Iconbox|{{Character Data|{{{1|{{PAGENAME}}}}}|unlocks}}|rarity={{Weapon Data|{{Character Data|{{{1|{{PAGENAME}}}}}|unlocks}}|rarity}}}}
  | #default = Error: "unlocktype" was not specified for "{{PAGENAME}}" in [[Template:Character_Data]]<!--
  | #default = Error: "unlocktype" was not specified for "{{{1|{{PAGENAME}}}}}" in [[Template:Character_Data]]<!--
-->}}
-->}}</onlyinclude></includeonly><noinclude>
 
== Example ==
 
Use on character pages:
 
<pre>{{CharacterUnlocks}}</pre>
 
Use anywhere:
 
<pre>{{CharacterUnlocks|Well Rounded}}</pre>
 
'''Example output is directly below (including the heading):'''
 
{{CharacterUnlocks|Well Rounded}}

Revision as of 01:48, 8 November 2022


Example

Use on character pages:

{{CharacterUnlocks}}

Use anywhere:

{{CharacterUnlocks|Well Rounded}}

Example output is directly below (including the heading):

Unlocks

Unlocks Potato if you win a game with Well Rounded: