Difference between revisions of "Template:Hunger"
(Created page with "{{#ifexpr: {{{1}}} > 0 | 12x12px|class=item-icon pixel|link=Hunger}}{{#ifexpr: {{{1}}} > 1.49 | File:ui-hunger.png|12x12px|class=item-icon pixel|link=...") |
(Display the empty hunger icon if value is equal or lower than 0, and added possibilty to change normal hunger icons for the poisoned one if using the parameter "poisoned") |
||
Line 1: | Line 1: | ||
− | {{#ifexpr: {{{1}}} > 0 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 1.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 2.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 3.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 4.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 5.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 6.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 7.49 | [[File:ui-hunger.png|12x12px|class=item-icon pixel|link=Hunger]] | + | {{#ifexpr: {{{1}}} > 0 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]] | {{#ifexpr: {{{1}}} = 0 or {{{1}}} < 0 | [[File:ui-hunger-empty.png|12x12px|class=item-icon pixel|link=Hunger]]}}}}{{#ifexpr: {{{1}}} > 1.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 2.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 3.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 4.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 5.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 6.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 7.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 8.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}} |
+ | {{#ifexpr: {{{1}}} > 9.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}<noinclude> | ||
== About == | == About == | ||
This template serves to display hunger points in a page. | This template serves to display hunger points in a page. | ||
== Usage == | == Usage == | ||
− | The syntax of this template is <code><nowiki>{{Hunger|<number>}}</nowiki></code>. If the value given is <code>0</code> or lower, it will display nothing, and if the value is higher than <code>10</code>, it will display 10 hunger icons. It can also round to the nearest integer. | + | The syntax of this template is <code><nowiki>{{Hunger|<number>|<poisoned>?}}</nowiki></code>. If the value given is <code>0</code> or lower, it will display nothing, and if the value is higher than <code>10</code>, it will display 10 hunger icons. It can also round to the nearest integer. When using the <code>poisoned</code> parameter (no value required), all hunger icons will change to it's poisoned version. |
== Examples == | == Examples == | ||
Line 23: | Line 24: | ||
* <code><nowiki>{{Hunger|1.5}}</nowiki></code> → {{Hunger|1.5}} | * <code><nowiki>{{Hunger|1.5}}</nowiki></code> → {{Hunger|1.5}} | ||
* <code><nowiki>{{Hunger|1.75}}</nowiki></code> → {{Hunger|1.75}} | * <code><nowiki>{{Hunger|1.75}}</nowiki></code> → {{Hunger|1.75}} | ||
+ | |||
+ | Poisoned examples: | ||
+ | * <code><nowiki>{{Hunger|5|Poisoned}}</nowiki></code> → {{Hunger|5|Poisoned}} | ||
+ | * <code><nowiki>{{Hunger|6.5|Poisoned}}</nowiki></code> → {{Hunger|6.5|Poisoned}} | ||
+ | * <code><nowiki>{{Hunger|3|Poisoned}}</nowiki></code> → {{Hunger|3|Poisoned}} | ||
</noinclude> | </noinclude> |
Revision as of 11:41, 5 July 2022
Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".{{#ifexpr: {{{1}}} > 7.49 | }Expression error: Unrecognized punctuation character "{". Expression error: Unrecognized punctuation character "{".
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 (no value required), all hunger icons will change to it's poisoned version.
Examples
Rounding examples:
Poisoned examples: