Difference between revisions of "Template:Hunger"
Jump to navigation
Jump to search
If you find a typo, inconsistency, or error, please sign up and help out the wiki! We can't do it without your help! :D Thank you!
(Re-wrote code) |
(Updated sizing spec as with Template:Health) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#switch: {{{1}}} | <includeonly>{{#switch: {{{1}}} | ||
− | | 0 = 0 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}-empty.png|{{{2| | + | | 0 = 0 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}-empty.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|0 hunger points]]) |
− | | 1 = 1 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 1 = 1 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|1 hunger point]]) |
− | | 2 = 2 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 2 = 2 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|2 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|2 hunger points]]) |
− | | 3 = 3 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 3 = 3 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|3 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|3 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|3 hunger points]]) |
− | | 4 = 4 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 4 = 4 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]]) |
− | | 5 = 5 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 5 = 5 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]]) |
− | | 6 = 6 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 6 = 6 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]]) |
− | | 7 = 7 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 7 = 7 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]]) |
− | | 8 = 8 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 8 = 8 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]]) |
− | | 9 = 9 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 9 = 9 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]]) |
− | | 10 = 10 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | 10 = 10 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]]) |
− | | #default = {{{1}}} ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2| | + | | #default = {{{1}}} ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|1 hunger point]] × {{{1}}}) |
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
− | + | {{Documentation}} | |
− | + | <!-- Put categories/interwiki on the documentation page. --> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</noinclude> | </noinclude> |
Latest revision as of 14:09, 11 July 2023
About
This template serves to display hunger points in a page.
Usage
The syntax of this template is {{Hunger|<number>|<poisoned>?}}
. If the value given is 0
or lower, it will display nothing, and if the value is higher than 10
, it will display 10 hunger icons. It can also round to the nearest integer. When using the poisoned
parameter with the true
value, all hunger icons will change to it's poisoned version.
Examples
{{Hunger|0}}
→ 0 (){{Hunger|1}}
→ 1 (){{Hunger|2}}
→ 2 (){{Hunger|3}}
→ 3 (){{Hunger|4}}
→ 4 (){{Hunger|5}}
→ 5 (){{Hunger|6}}
→ 6 (){{Hunger|7}}
→ 7 (){{Hunger|8}}
→ 8 (){{Hunger|9}}
→ 9 (){{Hunger|10}}
→ 10 ()
Rounding examples:
{{Hunger|1.25}}
→ 1.25 ( × 1.25){{Hunger|1.5}}
→ 1.5 ( × 1.5){{Hunger|14.75}}
→ 14.75 ( × 14.75)
Poisoned examples:
{{Hunger|5|poisoned=true}}
→ 5 (){{Hunger|6.5|poisoned=true}}
→ 6.5 ( × 6.5){{Hunger|3|poisoned=true}}
→ 3 ()