From Brotato Wiki
(Add options for "unlockedby" and "unlocks") |
(Docs: Add "wantedtags" to main example) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<div class="itembox" style="float:right;width:90%;max-width:400px;"> | <div class="itembox" style="{{#ifeq:{{{nofloat|}}}|1|<!--no float (for docs) -->float:none;|float:right;}}<!-- | ||
-->width:90%;max-width:400px;"> | |||
<div class="itemboxheader"> | <div class="itemboxheader"> | ||
<div style="float:left"> | <div style="float:left"> | ||
Line 15: | Line 16: | ||
{{#if:{{{stats|}}}| | {{#if:{{{stats|}}}| | ||
<div class="line"></div> | <div class="line"></div> | ||
<div class="stats-container"> | <div class="stats-container" style="padding: 10px 0;"> | ||
<div style="font-weight:bold; color:rgb(234,226,176);">Stats</div> | <div style="font-weight:bold; color:rgb(234,226,176);">Stats</div> | ||
{{{stats}}} | <div>{{{stats}}}</div> | ||
</div> | </div> | ||
|}} | |}} | ||
{{#if:{{{unlockedby|}}}| | {{#if:{{{unlockedby|}}}| | ||
<div class="line"></div> | <div class="line" style="opacity: 0.5"></div> | ||
<div class="stats-container"> | <div class="stats-container" style="padding: 10px 0;"> | ||
<div style="font-weight:bold; color:rgb(234,226,176);">Unlocked By</div> | <div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">Unlocked By</div> | ||
{{{unlockedby}}} | <div>{{{unlockedby}}}</div> | ||
</div> | </div> | ||
|}} | |}} | ||
{{#if:{{{unlocks|}}}| | {{#if:{{{unlocks|}}}| | ||
<div class="line"></div> | <div class="line" style="opacity: 0.5"></div> | ||
<div class="stats-container"> | <div class="stats-container" style="padding: 10px 0;"> | ||
<div style="font-weight:bold; color:rgb(234,226,176);">Unlocks</div> | <div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">Unlocks</div> | ||
{{ | <div> | ||
<!-- Item or weapon --> | |||
{{#switch: {{lc:{{{unlocktype}}}}} | |||
| item = {{Iconbox|{{{unlocks}}}|rarity={{Item Data|{{{unlocks}}}|rarity}}|nobr=1|size=30px}} | |||
| weapon = {{Iconbox|{{{unlocks}}}|rarity={{Weapon Data|{{{unlocks}}}|rarity}}|nobr=1|size=30px}} | |||
| #default = Error: "unlocktype" was not specified, or was not either "weapon" or "item" (provided: "{{{unlocktype}}}")<!-- | |||
-->}} | |||
</div> | |||
</div> | |||
|}} | |||
{{#if:{{{wantedtags|}}}| | |||
<div class="line" style="opacity: 0.5"></div> | |||
<div class="stats-container" style="padding: 10px 0;"> | |||
<div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">[[Items#Item_Tags|Item Tags]]</div> | |||
<div>{{{wantedtags}}}</div> | |||
</div> | </div> | ||
|}} | |}} | ||
Line 38: | Line 53: | ||
<noinclude> | <noinclude> | ||
== Usage == | == Usage == | ||
Shows an infobox for a [[Characters|Character]]. Accepts custom data, but should ideally be used with [[Template:Character_Data]]. | |||
Note: The helper template [[Template:Infobox_Character_Helper]] (<code><nowiki>{{Infobox_Character_Helper}}</nowiki></code>) can be used on individual character pages, and automatically populates the data for you. | |||
=== With Character_Data === | |||
This uses [[Template:Character_Data|Character_Data]], and is the recommended approach. | |||
<pre> | <pre> | ||
{{Infobox Character | {{Infobox Character | ||
|name= | |name = Bull | ||
|stats= {{Character Data| | |stats = {{Character Data|Bull|stats}} | ||
|unlockedby= {{Character Data| | |unlockedby = {{Character Data|Bull|unlockedby}} | ||
|unlocks= {{Character Data| | |unlocks = {{Character Data|Bull|unlocks}} | ||
|unlocktype = {{Character Data|Bull|unlocktype}} | |||
|wantedtags = {{Character Data|Bull|wantedtags}} | |||
}} | }} | ||
</pre> | </pre> | ||
'''Result:''' | |||
{{Infobox Character | {{Infobox Character | ||
|name= | |name = Bull | ||
|stats= {{Character Data| | |stats = {{Character Data|Bull|stats}} | ||
|unlockedby= {{Character Data| | |unlockedby = {{Character Data|Bull|unlockedby}} | ||
|unlocks= {{Character Data| | |unlocks = {{Character Data|Bull|unlocks}} | ||
|unlocktype = {{Character Data|Bull|unlocktype}} | |||
|wantedtags = {{Character Data|Bull|wantedtags}} | |||
|nofloat = 1 | |||
}} | }} | ||
< | === Custom Text === | ||
<pre>{{Infobox Character | |||
|name = Tree | |||
|stats = {{Color|green|+10}} Good vibes | |||
|unlockedby = Go on a walk somewhere nice | |||
|wantedtags = [[Exploration]] | |||
}} | |||
</pre> | |||
'''Result:''' | |||
{{Infobox Character | |||
|name = Tree | |||
|stats = {{Color|green|+10}} Good vibes | |||
|unlockedby = Go on a walk somewhere nice | |||
|wantedtags = [[Exploration]] | |||
|nofloat = 1 | |||
}} | |||
</noinclude> | </noinclude> |
Latest revision as of 03:07, 9 November 2022
Usage
Shows an infobox for a Character. Accepts custom data, but should ideally be used with Template:Character_Data.
Note: The helper template Template:Infobox_Character_Helper ({{Infobox_Character_Helper}}
) can be used on individual character pages, and automatically populates the data for you.
With Character_Data
This uses Character_Data, and is the recommended approach.
{{Infobox Character |name = Bull |stats = {{Character Data|Bull|stats}} |unlockedby = {{Character Data|Bull|unlockedby}} |unlocks = {{Character Data|Bull|unlocks}} |unlocktype = {{Character Data|Bull|unlocktype}} |wantedtags = {{Character Data|Bull|wantedtags}} }}
Result:
Stats
Unlocked By
Win a run in Danger 1
Unlocks
Custom Text
{{Infobox Character |name = Tree |stats = {{Color|green|+10}} Good vibes |unlockedby = Go on a walk somewhere nice |wantedtags = [[Exploration]] }}
Result: