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

From Captain of Industry Wiki
Jump to: navigation, search
(Created Template: Recipe item and moved some codes there. The moved codes are ones to draw plus icon, item icon and the quantity of item.)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><templatestyles src="Template:Recipe draw/styles.css" /><!--


   ** Clear variables in case of multiple uses on one page **
   ** Clear variables in case of multiple uses on one page **
Line 7: Line 6:
-->{{#vardefine: accepts | no}}<!--
-->{{#vardefine: accepts | no}}<!--
-->{{#vardefine: provides | no}}<!--
-->{{#vardefine: provides | no}}<!--
-->{{#vardefine: special_output | no}}<!--
   
   
   ** Set up variables to specify desired settings and reuse code **
   ** Set up variables to specify desired settings and reuse code **
Line 16: Line 16:
-->{{#vardefine: imgsz_reg | 48x48px }}<!--
-->{{#vardefine: imgsz_reg | 48x48px }}<!--


  ** List of pollution: must input in small latter **
-->{{#vardefine: pollution_1 | air pollution }}<!--
-->{{#vardefine: pollution_2 | water pollution }}<!--
-->{{#vardefine: pollution_3 | }}<!--
-->{{#vardefine: pollution_4 | }}<!--
  ** Apply style **
--><templatestyles src="Template:Recipe draw/styles.css" /><!--
--><div class="recipe-wrapper {{#if: {{{Unreleased|}}} | unreleased_border}}"><!--
--><div class="recipe-wrapper {{#if: {{{Unreleased|}}} | unreleased_border}}"><!--


   ** Special output for when `Mining = yes` **
   ** Special output for when `Mining = yes` **


-->{{#if: {{{Mining|}}} |<!--
-->{{#ifeq: {{lc:{{{Input1Name|}}}}} | mining |<!--
   --><div class="block">[[File:Mining.png{{!}}{{#var: imgsz_large}}{{!}}link=Mining]]</div><!--
   --><div class="block">[[File:Mining.png{{!}}{{#var: imgsz_large}}{{!}}link=Designations#Mining]]</div><!--
   --><div class="block">{{#var: img_arrow}}</div><!--
   --><div class="block">{{#var: img_arrow}}</div><!--
   --><div class="block">[[File:{{{Output1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Output1Name}}}]]</div><!--
   --><div class="block">[[File:{{{Output1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Output1Name}}}]]</div><!--
  -->{{#vardefine: special_output | yes}}<!--
-->}}<!--
-->}}<!--


   ** Special output for when `Dumping = yes` **
   ** Special output for when `Dumping = yes` **


-->{{#if: {{{Dumping|}}} |<!--
-->{{#ifeq: {{lc:{{{Output1Name|}}}}} | dumping |<!--
   --><div class="block">[[File:{{{Input1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Input1Name}}}]]</div><!--
   --><div class="block">[[File:{{{Input1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Input1Name}}}]]</div><!--
   --><div class="block">{{#var: img_arrow}}</div><!--
   --><div class="block">{{#var: img_arrow}}</div><!--
   --><div class="block">[[File:Dumping.png{{!}}{{#var: imgsz_large}}{{!}}link=Dumping]]</div><!--
   --><div class="block">[[File:Dumping.png{{!}}{{#var: imgsz_large}}{{!}}link=Designations#Dumping]]</div><!--
  -->{{#vardefine: special_output | yes}}<!--
-->}}<!--
-->}}<!--


   ** Stop output if we drew Mining or Dumping **
   ** Stop output if we drew Mining or Dumping **


-->{{#if: {{{Mining|}}}{{{Dumping|}}} ||<!--
-->{{#ifeq: {{#var: special_output}} | no |<!--


   ** Check if Template:Infobox_machine already knows the building. If not, try the `Building` param. **
   ** Check if Template:Infobox_machine already knows the building. If not, try the `Building` param. **
Line 52: Line 64:


-->{{#if: {{{Input1Name|}}}{{{Input2Name|}}}{{{Input3Name|}}}{{{Input4Name|}}}{{{Input5Name|}}}{{{Input6Name|}}} || {{#vardefine: provides | yes}} }} <!--
-->{{#if: {{{Input1Name|}}}{{{Input2Name|}}}{{{Input3Name|}}}{{{Input4Name|}}}{{{Input5Name|}}}{{{Input6Name|}}} || {{#vardefine: provides | yes}} }} <!--
-->{{#switch: {{lc:{{{Output1Name|}}}{{{Output2Name|}}}{{{Output3Name|}}}{{{Output4Name|}}}{{{Output5Name|}}}{{{Output6Name|}}}}}
-->{{#vardefine: combined_output | {{lc:{{{Output1Name|}}}{{{Output2Name|}}}{{{Output3Name|}}}{{{Output4Name|}}}{{{Output5Name|}}}{{{Output6Name|}}} }} }}<!--
     | air pollution
-->{{#ifeq: <!--
     | water pollution
  -->{{#expr: <!--
     | = {{#vardefine: accepts| yes}}
     -->    {{#ifeq: {{#var: combined_output}} | {{#var: pollution_1}} | 1 | 0 }} <!--
   }}<!--
     --> or {{#ifeq: {{#var: combined_output}} | {{#var: pollution_2}} | 1 | 0 }} <!--
}}<!--
     --> or {{#ifeq: {{#var: combined_output}} | {{#var: pollution_3}} | 1 | 0 }} <!--
    --> or {{#ifeq: {{#var: combined_output}} | {{#var: pollution_4}} | 1 | 0 }} <!--
    --> or {{#ifeq: {{#var: combined_output}} | | 1 | 0 }} <!--
  -->}} | 1 | <!--
   -->{{#vardefine: accepts| yes}} | <!--
-->}} <!--
 


   ** Main sequence starts here **
   ** Main sequence starts here **
Line 75: Line 93:
-->{{#ifeq: {{#var: provides}} | yes | <div class="block accepts-provides">PROVIDES</div> }}<!--
-->{{#ifeq: {{#var: provides}} | yes | <div class="block accepts-provides">PROVIDES</div> }}<!--


   ** Draw 1st input unless {{#var: provides}} is `yes`. **
   ** Draw outputs except pollution if {{#var: provides}} is `yes`. **
  ** Draw input unless {{#var: provides}} is `yes`. **


-->{{#ifeq: {{#var: provides}} | yes || <!--
-->{{#ifeq: {{#var: provides}} | yes |<!--
  -->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} | Pollution = hide }}<!--
  -->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Pollution = hide | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Pollution = hide | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Pollution = hide | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Pollution = hide | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Pollution = hide | Plus = yes }}<!--
  -->|<!--
   -->{{Recipe item | Name = {{{Input1Name|}}} | Quantity = {{{Input1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input1Unit|}}} }} <!--
   -->{{Recipe item | Name = {{{Input1Name|}}} | Quantity = {{{Input1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input1Unit|}}} }} <!--
  -->{{Recipe item | Name = {{{Input2Name|}}} | Quantity = {{{Input2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input2Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Input3Name|}}} | Quantity = {{{Input3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input3Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Input4Name|}}} | Quantity = {{{Input4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input4Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Input5Name|}}} | Quantity = {{{Input5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input5Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Input6Name|}}} | Quantity = {{{Input6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input6Unit|}}} | Plus = yes }}<!--
-->}}<!--
-->}}<!--


  ** Draw outputs instead if {{#var: provides}} is `yes`. **
-->{{#ifeq: {{#var: provides}} | yes |<!--
  -->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} }}<!--
  -->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Plus = yes }}<!--
  -->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Plus = yes }}<!--
-->}}<!--
  ** Draw 2nd-6th input **
-->{{Recipe item | Name = {{{Input2Name|}}} | Quantity = {{{Input2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input2Unit|}}} | Plus = yes }}<!--
-->{{Recipe item | Name = {{{Input3Name|}}} | Quantity = {{{Input3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input3Unit|}}} | Plus = yes }}<!--
-->{{Recipe item | Name = {{{Input4Name|}}} | Quantity = {{{Input4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input4Unit|}}} | Plus = yes }}<!--
-->{{Recipe item | Name = {{{Input5Name|}}} | Quantity = {{{Input5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input5Unit|}}} | Plus = yes }}<!--
-->{{Recipe item | Name = {{{Input6Name|}}} | Quantity = {{{Input6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input6Unit|}}} | Plus = yes }}<!--


   ** Draw the recipe times unless it has a unit defined (KW, MW, etc). **
   ** Draw the recipe times unless it has a unit defined (KW, MW, etc). **
Line 111: Line 124:
     -->{{#ifeq: {{lc:{{{Time}}}}} | <!-- instant --> 0 | <div>{{#var: img_arrow}}</div> |<!--
     -->{{#ifeq: {{lc:{{{Time}}}}} | <!-- instant --> 0 | <div>{{#var: img_arrow}}</div> |<!--
       --><div class="upper"><!--
       --><div class="upper"><!--
         -->{{#ifeq: {{#var: provides}} | yes |<!--
         -->{{#ifeq: {{#var: provides}} | yes | /&nbsp; }}<!--
          -->/&nbsp; |<!--
        -->{{#ifeq: {{#var: accepts}} | yes | /&nbsp; }}<!--
          -->{{#ifeq: {{#var: accepts}} | yes |<!--
            -->/&nbsp;<!--
          -->}}<!--
        -->}}<!--
         -->{{{Time}}}&nbsp;[[File:Clock.png|link=Time|16x16px]]<!--
         -->{{{Time}}}&nbsp;[[File:Clock.png|link=Time|16x16px]]<!--
       --></div><!--
       --></div><!--
       --><div><!--
       --><div><!--
         -->{{#ifeq: {{#var: provides}} | yes |<!--
         -->{{#ifeq: {{#var: provides}} | yes | <br/> |<!--
          --><br/> |<!--
           -->{{#ifeq: {{#var: accepts}} | yes | <br/> |<!--
           -->{{#ifeq: {{#var: accepts}} | yes |<!--
            --><br/> |<!--
             -->{{#var: img_arrow}}<!--
             -->{{#var: img_arrow}}<!--
           -->}}<!--
           -->}}<!--
Line 129: Line 136:
       --></div><!--
       --></div><!--
       --><div class="lower blue"><!--
       --><div class="lower blue"><!--
         -->{{#ifeq: {{#var: provides}} | yes |<!--
         -->{{#ifeq: {{#var: provides}} | yes | /&nbsp; }}<!--
          -->/&nbsp; |<!--
        -->{{#ifeq: {{#var: accepts}} | yes | /&nbsp; }}<!--
          -->{{#ifeq: {{#var: accepts}} | yes |<!--
            -->/&nbsp;<!--
          -->}}<!--
        -->}}<!--
         -->60&nbsp;[[File:Clock 60s.png|link=Time|16x16px]]<!--
         -->60&nbsp;[[File:Clock 60s.png|link=Time|16x16px]]<!--
       --></div><!--
       --></div><!--
Line 141: Line 144:
-->}}<!--
-->}}<!--


   ** Draw outputs unless {{#var: provides}} is `yes` **
 
   ** Draw outputs except pollution unless {{#var: provides}} is `yes` **


-->{{#ifeq: {{#var: provides}} | yes ||<!--
-->{{#ifeq: {{#var: provides}} | yes ||<!--
 
   -->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} | Pollution = hide }}<!--
   ** If {{#var: accepts}} is `yes`, then draw a vertical line **
   -->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Pollution = hide | Plus = yes }}<!--
 
  -->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Pollution = hide | Plus = yes }}<!--
   -->{{#if: {{{Output1Name|}}} |<!--
  -->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Pollution = hide | Plus = yes }}<!--
    -->{{#ifeq: {{#var: accepts}} | yes |<!--
  -->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Pollution = hide | Plus = yes }}<!--
      --><div style="display: inline-block;
  -->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Pollution = hide | Plus = yes }}<!--
                    vertical-align: middle;
                    min-height: 90px;
                    border-left: 2px solid #6d6d6d;
                    margin-right: 11px"
        ></div><!--
    -->}}<!--
   -->}}<!--
   -->}}<!--
 
  ** Draw vertical line and pollution if pollution exists **


  ** Draw all output **
-->{{#vardefine: all_pollutions |<!--
 
   -->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} | Pollution = only }}<!--
   -->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} }}<!--
   -->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Pollution = only }}<!--
   -->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Plus = yes }}<!--
   -->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Pollution = only }}<!--
   -->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Plus = yes }}<!--
   -->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Pollution = only }}<!--
   -->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Plus = yes }}<!--
   -->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Pollution = only }}<!--
   -->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Plus = yes }}<!--
   -->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Pollution = only }}<!--
   -->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Plus = yes }}<!--
-->}}<!--
-->{{#if: {{#var: all_pollutions}} |<!--
  -->&emsp;<!--
  --><div style="display: inline-block;
                vertical-align: middle;
                min-height: 90px;
                border-left: 2px solid #6d6d6d;
                margin-right: 11px"
  --></div><!--
  -->{{#var: all_pollutions}}<!--
-->}}<!--
-->}}<!--


Line 175: Line 184:


{{Recipe draw/sandbox
{{Recipe draw/sandbox
   | Mining     = yes
   | Input1Name  = Mining
   | Output1Name = Copper Ore
   | Output1Name = Copper Ore
}}
}}


{{Recipe draw/sandbox
{{Recipe draw/sandbox
   | Dumping   = yes
   | Output1Name = Dumping
   | Input1Name = Rock
   | Input1Name = Rock
}}
}}


Line 251: Line 260:
   | Input1Qty  = 48
   | Input1Qty  = 48
   | Output1Name = Iron Scrap
   | Output1Name = Iron Scrap
   | Output1Qty  = ?
   | Output1Unit = ?
   | Output2Name = Copper Scrap
   | Output2Name = Copper Scrap
   | Output2Qty  = ?
   | Output2Unit = ?
   | Output3Name = Gold Scrap
   | Output3Name = Gold Scrap
   | Output3Qty  = ?
   | Output3Unit = ?
   | Output4Name = Broken Glass
   | Output4Name = Broken Glass
   | Output4Qty  = ?
   | Output4Unit = ?
}}
}}


Line 292: Line 301:


{{Recipe draw/sandbox
{{Recipe draw/sandbox
   | Building    = Mixer
   | Building    = Air Separator
  | Input1Name  = Sand
  | Input1Qty  = 18
  | Input2Name  = Limestone
  | Input2Qty  = 4
  | Input3Name  = Salt
  | Input3Qty  = 4
   | Time        = 20
   | Time        = 20
   | Output1Name = Glass Mix
   | Output1Name = Oxygen
   | Output1Qty  = 14
   | Output1Qty  = 12
  | Output2Name = Nitrogen
  | Output2Qty  = 12
  | Output3Name = Water Pollution
  | Output3Qty  = -1
   | Unreleased  = yes
   | Unreleased  = yes
}}
{{Recipe draw/sandbox
  | Building    =
  | Time        = 20
  | Output1Name = Oxygen
  | Output1Qty  = 12
  | Output2Name = Nitrogen
  | Output2Qty  = 12
}}
}}
</noinclude>
</noinclude>

Latest revision as of 14:08, 16 May 2023


Mining.png
Transform.png
Copper Ore.png
Rock.png
Transform.png
Dumping.png
Rotary Kiln.png
:
12
Limestone.png
72
Plus.png
2
Coal.png
12
10 Clock.png
Transform.png
60 Clock 60s.png
4
Cement.png
24
Plus.png
8
Exhaust.png
48
Air Separator.png
:
PROVIDES
12
Oxygen.png
36
Plus.png
12
Nitrogen.png
36
/ 20 Clock.png

/ 60 Clock 60s.png
Smoke Stack.png
:
ACCEPTS
200
Oxygen.png
600
/ 20 Clock.png

/ 60 Clock 60s.png
Liquid Dump.png
:
ACCEPTS
2
Waste Water.png
60
/ 2 Clock.png

/ 60 Clock 60s.png
2
Water Pollution.png
60
Low-pressure Turbine.png
:
4
Steam Lo.png
48
Clock.png
Transform.png
60 Clock 60s.png
 
Mechanical Power.png
1 MW
Plus.png
4
Steam Depleted.png
48
Power Generator.png
:
 
Mechanical Power.png
500 KW
Transform.png
 
Electricity.png
250 KW
Waste Sorting Plant.png
:
48
Recyclables.png
144
20 Clock.png
Transform.png
60 Clock 60s.png
?
Iron Scrap.png
?
Plus.png
?
Copper Scrap.png
?
Plus.png
?
Gold Scrap.png
?
Plus.png
?
Broken Glass.png
?
Exhaust Scrubber.png
:
30
Exhaust.png
180
Plus.png
4
Water.png
24
10 Clock.png
Transform.png
60 Clock 60s.png
1
Sulfur.png
6
Plus.png
12
Carbon Dioxide.png
72
Plus.png
4
Steam Lo.png
24
4
Air Pollution.png
24
18
Sand.png
54
Plus.png
4
Limestone.png
12
Plus.png
4
Salt.png
12
20 Clock.png
Transform.png
60 Clock 60s.png
14
Glass Mix.png
42
Air Separator.png
:
PROVIDES
12
Oxygen.png
36
Plus.png
12
Nitrogen.png
36
/ 20 Clock.png

/ 60 Clock 60s.png
-1
Water Pollution.png
-3
UNRELEASED
Building not defined