Difference between revisions of "Template:Recipe item/sandbox"

From Captain of Industry Wiki
Jump to: navigation, search
(Changed condition to display "?" as a quantity of item: now displays it when Unit is set to "?".)
(Added an option for hiding or showing only pollution)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--


-->{{#if: {{{Name|}}}|<!--
  ** Check if {{{Name}}} is pollution (or empty) **
 
-->{{#ifeq: <!--
  -->{{#expr: <!--
    -->    {{#ifeq: {{lc:{{{Name|}}} }} | {{#var: pollution_1}} | 1 | 0 }} <!--
    --> or {{#ifeq: {{lc:{{{Name|}}} }} | {{#var: pollution_2}} | 1 | 0 }} <!--
    --> or {{#ifeq: {{lc:{{{Name|}}} }} | {{#var: pollution_3}} | 1 | 0 }} <!--
    --> or {{#ifeq: {{lc:{{{Name|}}} }} | {{#var: pollution_4}} | 1 | 0 }} <!--
  -->}} | 1 | <!--
  -->{{#vardefine: is_pollution| 1 }} | <!--
  -->{{#vardefine: is_pollution| 0 }} <!--
-->}} <!--
 
  ** Determine if we should display the icon **
 
-->{{#ifeq: <!--
  -->{{#expr: <!--
    -->    {{#if: {{{Name|}}} | 0 | 1 }} <!--
    --> or ( {{#ifeq: {{lc:{{{Pollution}}} }} | hide | 1 | 0 }} and {{#var: is_pollution}} ) <!--
    --> or ( {{#ifeq: {{lc:{{{Pollution}}} }} | only | 1 | 0 }} and (not {{#var: is_pollution}} )) <!--
  -->}} | 1 | <!-- Do nothing --> | <!--


   ** Draw plus icon **
   ** Draw plus icon **


   -->{{#ifeq: {{lc:{{{Plus|}}} }} | yes |<!--
   -->{{#ifeq: {{lc:{{{Plus|}}} }} | yes | <!--
     --><div class="block">{{#var: img_plus}}</div>|<!--
     --><div class="block">{{#var: img_plus}}</div>| <!--
     -->{{#ifeq: {{lc:{{{Plus|no}}} }} | no | |<!--
     -->{{#ifeq: {{lc:{{{Plus|no}}} }} | no | | <!--
       --><div class="block">{{{Plus}}}</div><!--
       --><div class="block">{{{Plus}}}</div> <!--
     -->}}<!--
     -->}}<!--
   -->}}<!--
   -->}}<!--
Line 29: Line 49:
   --></div><!--
   --></div><!--
-->}}<!--
-->}}<!--
</includeonly><noinclude>
--></includeonly><noinclude><!--
<templatestyles src="Template:Recipe draw/styles.css" />
 
{{#vardefine: img_plus | [[File:Plus.png|24x24px]] }}
--><templatestyles src="Template:Recipe draw/styles.css" /><!--
{{#vardefine: imgsz_reg | 48x48px }}
-->{{#vardefine: img_plus | [[File:Plus.png|24x24px]] }}<!--
<div class="recipe-wrapper>
-->{{#vardefine: imgsz_reg | 48x48px }}<!--
-->{{#vardefine: pollution_1 | air pollution }}<!--
-->{{#vardefine: pollution_2 | water pollution }}<!--
-->{{#vardefine: pollution_3 | }}<!--
-->{{#vardefine: pollution_4 | }}<!--
 
-->Show all:<!--
--><div class="recipe-wrapper><!--
-->{{Recipe item/sandbox|Name=Steam hi|Quantity=2|Time=10}}<!--
-->{{Recipe item/sandbox|Name=Cement|Quantity=0|Time=10|Plus=yes}}<!--
-->{{Recipe item/sandbox|Name=Electricity|Quantity=20|Unit=KW|Time=0|Plus=yes}}<!--
-->{{Recipe item/sandbox|Name=Iron Scrap|Unit=?|Time=10|Plus=yes}}<!--
-->{{Recipe item/sandbox|Name=Air Pollution|Quantity=15|Time=10|Plus=yes}}<!--
-->{{Recipe item/sandbox|Name=|Quantity=10|Time=10|Plus=yes}}<!--
--></div><!--
 
-->Pollution only:<!--
--><div class="recipe-wrapper><!--
-->{{Recipe item/sandbox|Name=Steam hi|Quantity=2|Time=10|Pollution=only}}<!--
-->{{Recipe item/sandbox|Name=Cement|Quantity=0|Time=10|Plus=yes|Pollution=only}}<!--
-->{{Recipe item/sandbox|Name=Electricity|Quantity=20|Unit=KW|Time=0|Plus=yes|Pollution=only}}<!--
-->{{Recipe item/sandbox|Name=Iron Scrap|Unit=?|Time=10|Plus=yes|Pollution=only}}<!--
-->{{Recipe item/sandbox|Name=Air Pollution|Quantity=15|Time=10|Plus=yes|Pollution=only}}<!--
-->{{Recipe item/sandbox|Name=|Quantity=10|Time=10|Plus=yes}}<!--
--></div><!--


{{Recipe item/sandbox|Name=Steam hi|Quantity=2|Time=10}}
-->Hide pollution:<!--
{{Recipe item/sandbox|Name=Cement|Quantity=2|Time=10|Plus=yes}}
--><div class="recipe-wrapper><!--
{{Recipe item/sandbox|Name=Electricity|Quantity=20|Unit=KW|Plus=yes}}
-->{{Recipe item/sandbox|Name=Steam hi|Quantity=2|Time=10|Pollution=hide}}<!--
{{Recipe item/sandbox|Name=Iron Scrap|Unit=?|Time=10|Plus=yes}}
-->{{Recipe item/sandbox|Name=Cement|Quantity=0|Time=10|Plus=yes|Pollution=hide}}<!--
{{Recipe item/sandbox|Name=Copper|Time=10|Plus=yes}}
-->{{Recipe item/sandbox|Name=Electricity|Quantity=20|Unit=KW|Time=0|Plus=yes|Pollution=hide}}<!--
-->{{Recipe item/sandbox|Name=Iron Scrap|Unit=?|Time=10|Plus=yes|Pollution=hide}}<!--
-->{{Recipe item/sandbox|Name=Air Pollution|Quantity=15|Time=10|Plus=yes|Pollution=hide}}<!--
-->{{Recipe item/sandbox|Name=|Quantity=10|Time=10|Plus=yes}}<!--
--></div><!--


</div>
--></noinclude>
</noinclude>

Revision as of 14:27, 3 October 2022

Show all:

Plus.png
0
Cement.png
0
Plus.png
 
Electricity.png
20 KW
Plus.png
 ?
Iron Scrap.png
 ?
Plus.png
15
Air Pollution.png
90

Pollution only:

Plus.png
15
Air Pollution.png
90

Hide pollution:

Plus.png
0
Cement.png
0
Plus.png
 
Electricity.png
20 KW
Plus.png
 ?
Iron Scrap.png
 ?