Difference between revisions of "Template:Energy"

From Stardew Valley Wiki
Jump to navigation Jump to search
(poison icon when negative)
(indentation + error handling)
Line 1: Line 1:
<includeonly><span id="nametemplate">{{#if:{{{1|}}}|
+
<includeonly><span id="nametemplate">
{{#ifexpr:{{#expr:{{{1|}}}<0}}|[[File:Poison.png|24px|link=]]|[[File:Energy.png|24px|link=]]}}|[[File:Energy.png|24px|link=]]}} {{{1|}}}{{#if: {{{2|}}}|&nbsp;({{{2|}}})|}}</span></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>
+
{{#iferror:{{#expr:{{{1|}}}<0}}|
 +
    [[File:Energy.png|24px|link=]]
 +
    |
 +
    {{#if:{{{1|}}}|
 +
        {{#ifexpr:{{#expr:{{{1|}}}<0}}|
 +
            [[File:Poison.png|24px|link=]]
 +
            |
 +
            [[File:Energy.png|24px|link=]]
 +
        }}
 +
        |
 +
        [[File:Energy.png|24px|link=]]
 +
    }}
 +
}}
 +
{{{1|}}}{{#if: {{{2|}}}|&nbsp;({{{2|}}})|}}
 +
</span></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>

Revision as of 05:00, 9 October 2016

Description

This template is used to insert File:Energy.png or File:Poison.png in-line with text.

Use

This template can be used by entering the following onto a relevant page.

{{Energy|amount}}

Examples

{{Energy}}

Energy.png

{{Energy|100}}

Energy.png 100

{{Energy|-100}}

Poison.png -100