Difference between revisions of "Template:CropGrowthStages"

From TFC:TNG
Jump to navigation Jump to search
(New template)
 
m (Prevent line wrapping)
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
     "description": "This template shows the growth stages of a crop.",
 
     "description": "This template shows the growth stages of a crop.",
 
     "params": {
 
     "params": {
         "1": {
+
         "name": {
 
             "label": "Crop name",
 
             "label": "Crop name",
 
             "description": "The name of the crop to display",
 
             "description": "The name of the crop to display",
Line 11: Line 11:
 
             "required": true
 
             "required": true
 
         },
 
         },
         "2": {
+
         "maxgrowth": {
 
             "label": "Max growth",
 
             "label": "Max growth",
 
             "description": "The highest growth stage this crop grows to (maximum 9)",
 
             "description": "The highest growth stage this crop grows to (maximum 9)",
Line 21: Line 21:
 
}
 
}
 
</templatedata>
 
</templatedata>
 +
== Example ==
 +
{{CropGrowthStages|name=Barley|maxgrowth=7}}
 +
 
</noinclude>
 
</noinclude>
<onlyinclude><includeonly>{{#if: {{#expr: {{2}} >= 0}}|[[File:{{1}} 0.png|x50px]]}}{{#if: {{#expr: {{2}} >= 1}}|[[File:{{1}} 1.png|x50px]]}}{{#if: {{#expr: {{2}} >= 2}}|[[File:{{1}} 2.png|x50px]]}}{{#if: {{#expr: {{2}} >= 3}}|[[File:{{1}} 3.png|x50px]]}}{{#if: {{#expr: {{2}} >= 4}}|[[File:{{1}} 4.png|x50px]]}}{{#if: {{#expr: {{2}} >= 5}}|[[File:{{1}} 5.png|x50px]]}}{{#if: {{#expr: {{2}} >= 6}}|[[File:{{1}} 6.png|x50px]]}}{{#if: {{#expr: {{2}} >= 7}}|[[File:{{1}} 7.png|x50px]]}}{{#if: {{#expr: {{2}} >= 8}}|[[File:{{1}} 8.png|x50px]]}}{{#if: {{#expr: {{2}} >= 9}}|[[File:{{1}} 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