From Brotato Wiki

(Add support for item tags (`wantedtags`))
(Add support for item tags (cont.); Make some data display in columns (unlockedby, unlocks, wantedtags). I've left "Stats" as full-width because it often has lots of data, which would be less readable if displayed in a more narrow column)
Line 15: Line 15:
{{#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 -->
<!-- Item or weapon -->
{{#switch: {{lc:{{{unlocktype}}}}}
{{#switch: {{lc:{{{unlocktype}}}}}
Line 37: Line 38:
| #default = Error: "unlocktype" was not specified, or was not either "weapon" or "item" (provided: "{{{unlocktype}}}")<!--
| #default = Error: "unlocktype" was not specified, or was not either "weapon" or "item" (provided: "{{{unlocktype}}}")<!--
-->}}
-->}}
</div>
</div>
</div>
|}}
|}}
{{#if:{{{wantedtags|}}}|
{{#if:{{{wantedtags|}}}|
<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);">[[Items#Item_Tags|Item Tags]]</div>
<div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">[[Items#Item_Tags|Item Tags]]</div>
{{{wantedtags}}}
<div>{{{wantedtags}}}</div>
</div>
</div>
|}}
|}}
Line 88: Line 90:
|unlocks= {{Character Data|Well Rounded|unlocks}}
|unlocks= {{Character Data|Well Rounded|unlocks}}
|unlocktype= {{Character Data|Well Rounded|unlocktype}}
|unlocktype= {{Character Data|Well Rounded|unlocktype}}
|wantedtags= {{Character Data|Well Rounded|wantedtags}}
}}
}}



Revision as of 00:23, 7 November 2022


Usage

This template can be used by entering the following onto a relevant page. Do not use this on your user page. It is reserved for content pages.

{{Infobox Character
|name=Lucky
|stats='''+8''' Max HP<br>
'''+4%'''Dodge<br>
}}

Results in:


Lucky
Lucky
Character
Stats
+8 Max HP
+4%Dodge




With Template:Character_Data (recommended):

{{Infobox Character 
|name=Well Rounded
|stats= {{Character Data|Well Rounded|stats}}
|unlockedby= {{Character Data|Well Rounded|unlockedby}}
|unlocks= {{Character Data|Well Rounded|unlocks}}
|unlocktype= {{Character Data|Well Rounded|unlocktype}}
}}

Results in:


Well Rounded
Well Rounded
Character
Stats
+5 Max Hp
+5% Speed
+8 Harvesting
Unlocked By
Unlocked by default
Unlocks
Potato
  Potato
None