Difference between revisions of "Template:CropGrowthStages"

From TFC:TNG
Jump to navigation Jump to search
(Fix parameter references; use names instead of numbers)
m (Prevent line wrapping)
 
(2 intermediate revisions by the same user not shown)
Line 21: Line 21:
 
}
 
}
 
</templatedata>
 
</templatedata>
 +
== Example ==
 +
{{CropGrowthStages|name=Barley|maxgrowth=7}}
 +
 
</noinclude>
 
</noinclude>
<onlyinclude><includeonly>{{#if: {{#expr: {{{maxgrowth}}} >= 0}}|[[File:{{{name}}} 0.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 1}}|[[File:{{{name}}} 1.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 2}}|[[File:{{{name}}} 2.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 3}}|[[File:{{{name}}} 3.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 4}}|[[File:{{{name}}} 4.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 5}}|[[File:{{{name}}} 5.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 6}}|[[File:{{{name}}} 6.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 7}}|[[File:{{{name}}} 7.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 8}}|[[File:{{{name}}} 8.png|x50px]]}}{{#if: {{#expr: {{{maxgrowth}}} >= 9}}|[[File:{{{name}}} 9.png|x50px]]}}</includeonly></onlyinclude>
+
<onlyinclude><includeonly><span style="white-space: nowrap;">{{#ifexpr: {{{maxgrowth}}} >= 0|[[File:{{{name}}} 0.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 1|[[File:{{{name}}} 1.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 2|[[File:{{{name}}} 2.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 3|[[File:{{{name}}} 3.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 4|[[File:{{{name}}} 4.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 5|[[File:{{{name}}} 5.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 6|[[File:{{{name}}} 6.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 7|[[File:{{{name}}} 7.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 8|[[File:{{{name}}} 8.png|x50px]]}}{{#ifexpr: {{{maxgrowth}}} >= 9|[[File:{{{name}}} 9.png|x50px]]}}</span></includeonly></onlyinclude>

Latest revision as of 07:09, 8 September 2020

This template shows the growth stages of a crop.

Template parameters

ParameterDescriptionTypeStatus
Crop namename

The name of the crop to display

Example
Barley
Stringrequired
Max growthmaxgrowth

The highest growth stage this crop grows to (maximum 9)

Example
7
Numberrequired

Example

Barley 0.pngBarley 1.pngBarley 2.pngBarley 3.pngBarley 4.pngBarley 5.pngBarley 6.pngBarley 7.png