Template:Recipe draw/sandbox: Difference between revisions

From Captain of Industry Wiki
Jump to: navigation, search
NaK (talk | contribs)
m Changed code of checking pollution (only internal processing)
NaK (talk | contribs)
Reworked the algorithm of determining if draw a vertical line at the left of pollution. Now recipe with both product and pollution such as Exhaust Scrubber can be displayed the same format in the game.
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 24: Line 23:
-->{{#vardefine: pollution_4 | }}<!--
-->{{#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}}"><!--


Line 91: 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 147: 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 298: 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
}}
}}
</noinclude>
</noinclude>

Revision as of 16:11, 3 October 2022


:
12
72
2
12
10 
60 
4
24
8
48
:
PROVIDES
12
36
12
36
/ 20 

/ 60 
:
ACCEPTS
200
600
/ 20 

/ 60 
:
ACCEPTS
2
60
/ 2 

/ 60 
2
60
:
4
48
60 
 
1 MW
4
48
:
 
500 KW
 
250 KW
:
48
144
20 
60 
?
?
?
?
?
?
?
?
:
30
180
4
24
10 
60 
1
6
12
72
4
24
4
24
18
54
4
12
4
12
20 
60 
14
42
:
PROVIDES
12
36
12
36
/ 20 

/ 60 
-1
-3
UNRELEASED