Difference between revisions of "Template:Infobox Element"

From The Powder Toy
Jump to: navigation, search
m (Missing curly bracket)
(Use MaterialBtn for transitions, add example infobox, and allow turning off categories so that the example doesn't cause this template page to be categorised)
Line 7: Line 7:
 
| label2 = Section
 
| label2 = Section
 
| data2 = <span data-toggle="tooltip" data-original-title="{{{menusection}}}">{{#switch: {{{menusection|}}}
 
| data2 = <span data-toggle="tooltip" data-original-title="{{{menusection}}}">{{#switch: {{{menusection|}}}
   | SC_WALL = [[:Category:Walls|Walls]] [[Category:Walls]]
+
   | SC_WALL = [[:Category:Walls|Walls]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Walls]] | }}
   | SC_ELEC = [[:Category:Electronics|Electronics]] [[Category:Electronics]]
+
   | SC_ELEC = [[:Category:Electronics|Electronics]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Electronics]] | }}
   | SC_POWERED => [[:Category:Powered Materials|Powered Materials]] [[Category:Powered Materials]]
+
   | SC_POWERED => [[:Category:Powered Materials|Powered Materials]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Powered Materials]] | }}
   | SC_SENSOR => [[:Category:Sensors|Sensors]] [[Category:Sensors]]
+
   | SC_SENSOR => [[:Category:Sensors|Sensors]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Sensors]] | }}
   | SC_FORCE => [[:Category:Force|Force Elements]] [[Category:Force]]
+
   | SC_FORCE => [[:Category:Force|Force Elements]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Force]] | }}
   | SC_EXPLOSIVE = [[:Category:Explosives|Explosives]] [[Category:Explosives]]
+
   | SC_EXPLOSIVE = [[:Category:Explosives|Explosives]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Explosives]] | }}
   | SC_GAS = [[:Category:Gases|Gases]] [[Category:Gases]]
+
   | SC_GAS = [[:Category:Gases|Gases]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Gases]] | }}
   | SC_LIQUID = [[:Category:Liquids|Liquids]] [[Category:Liquids]]
+
   | SC_LIQUID = [[:Category:Liquids|Liquids]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Liquids]] | }}
   | SC_POWDERS = [[:Category:Powders|Powders]] [[Category:Powders]]
+
   | SC_POWDERS = [[:Category:Powders|Powders]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Powders]] | }}
   | SC_SOLIDS = [[:Category:Solids|Solids]] [[Category:Solids]]
+
   | SC_SOLIDS = [[:Category:Solids|Solids]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Solids]] | }}
   | SC_NUCLEAR = [[:Category:Radioactive|Radioactive]] [[Category:Radioactive]]
+
   | SC_NUCLEAR = [[:Category:Radioactive|Radioactive]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Radioactive]] | }}
   | SC_SPECIAL = [[:Category:Special|Special]] [[Category:Special]]
+
   | SC_SPECIAL = [[:Category:Special|Special]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Special]] | }}
   | SC_LIFE = [[:Category:Life|Game Of Life]] [[Category:Life]]
+
   | SC_LIFE = [[:Category:Life|Game Of Life]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Life]] | }}
   | SC_TOOL = [[:Category:Tools|Tools]] [[Category:Tools]]
+
   | SC_TOOL = [[:Category:Tools|Tools]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Tools]] | }}
   | SC_DECO = [[:Category:Tools|Decoration tools]] [[Category:Tools]]
+
   | SC_DECO = [[:Category:Tools|Decoration tools]] {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Tools]] | }}
 
   | SC_CRACKER = Shenanigans
 
   | SC_CRACKER = Shenanigans
 
   | SC_CRACKER2 = Shenanigans
 
   | SC_CRACKER2 = Shenanigans
Line 58: Line 58:
 
   {{#ifeq: {{{lowtemperaturetransition}}} | special |
 
   {{#ifeq: {{{lowtemperaturetransition}}} | special |
 
     transition occurs |
 
     transition occurs |
     {{Material|mat={{{lowtemperaturetransition}}}}}
+
     {{MaterialBtn | {{{lowtemperaturetransition}}}}}
 
   }} below {{Temperature|t={{{lowtemperature}}}}} | }}
 
   }} below {{Temperature|t={{{lowtemperature}}}}} | }}
 
| label32 = {{#if: {{{hightemperaturetransition|}}} | High temperature | }}
 
| label32 = {{#if: {{{hightemperaturetransition|}}} | High temperature | }}
Line 64: Line 64:
 
   {{#ifeq: {{{hightemperaturetransition}}} | special |
 
   {{#ifeq: {{{hightemperaturetransition}}} | special |
 
     transition occurs |
 
     transition occurs |
     {{Material|mat={{{hightemperaturetransition}}}}}
+
     {{MaterialBtn | {{{hightemperaturetransition}}}}}
 
   }} above {{Temperature|t={{{hightemperature}}}}} | }}
 
   }} above {{Temperature|t={{{hightemperature}}}}} | }}
 
| label33 = {{#if: {{{lowpressuretransition|}}} | Low pressure | }}
 
| label33 = {{#if: {{{lowpressuretransition|}}} | Low pressure | }}
Line 70: Line 70:
 
   {{#ifeq: {{{lowpressuretransition}}} | special |
 
   {{#ifeq: {{{lowpressuretransition}}} | special |
 
     transition occurs |
 
     transition occurs |
     {{Material|mat={{{lowpressuretransition}}}}}
+
     {{MaterialBtn | {{{lowpressuretransition}}}}}
 
   }} below {{{lowpressure}}} pressure | }}
 
   }} below {{{lowpressure}}} pressure | }}
 
| label34 = {{#if: {{{highpressuretransition|}}} | High pressure | }}
 
| label34 = {{#if: {{{highpressuretransition|}}} | High pressure | }}
Line 76: Line 76:
 
   {{#ifeq: {{{highpressuretransition}}} | special |
 
   {{#ifeq: {{{highpressuretransition}}} | special |
 
     transition occurs |
 
     transition occurs |
     {{Material|mat={{{highpressuretransition}}}}}
+
     {{MaterialBtn | {{{highpressuretransition}}}}}
 
   }} above {{{highpressure}}} pressure | }}
 
   }} above {{{highpressure}}} pressure | }}
 
| header40 = {{#if: {{#pos:{{{properties|}}} | PROP_}} | Misc properties |}}
 
| header40 = {{#if: {{#pos:{{{properties|}}} | PROP_}} | Misc properties |}}
| data46 = {{#if: {{#pos:{{{properties|}}}|PROP_CONDUCTS}} | Conducts electricity ([[Element:SPRK|SPRK]]) [[Category:Conductive]] | }}
+
| data46 = {{#if: {{#pos:{{{properties|}}}|PROP_CONDUCTS}} | Conducts electricity ([[Element:SPRK|SPRK]]) {{#ifeq: {{{nocat|0}}} | 0 | [[Category:Conductive]] | }} | }}
 
| data47 = {{#if: {{#pos:{{{properties|}}}|PROP_NEUTPENETRATE}} | Mangled by neutrons | }}
 
| data47 = {{#if: {{#pos:{{{properties|}}}|PROP_NEUTPENETRATE}} | Mangled by neutrons | }}
 
| data48 = {{#if: {{#pos:{{{properties|}}}|PROP_NEUTABSORB}} | Absorbs neutrons | }}
 
| data48 = {{#if: {{#pos:{{{properties|}}}|PROP_NEUTABSORB}} | Absorbs neutrons | }}
Line 86: Line 86:
 
| data51 = {{#if: {{#pos:{{{properties|}}}|PROP_RADIOACTIVE}} | Radioactive, harmful to [[STKM]] | }}
 
| data51 = {{#if: {{#pos:{{{properties|}}}|PROP_RADIOACTIVE}} | Radioactive, harmful to [[STKM]] | }}
 
}}
 
}}
[[Category:Elements]]
+
{{#ifeq: {{{nocat|0}}} | 0 | [[Category:Elements]] | }}
 
</includeonly><noinclude>
 
</includeonly><noinclude>
 
Infobox for displaying various element properties.
 
Infobox for displaying various element properties.
  
 
Most of them should be passed exactly as in the source code. However, the ''properties'' parameter should be space separated (so remove the pipes). Example: TYPE_LIQUID PROP_CONDUCTS PROP_NEUTPENETRATE PROP_LIFE_DEC
 
Most of them should be passed exactly as in the source code. However, the ''properties'' parameter should be space separated (so remove the pipes). Example: TYPE_LIQUID PROP_CONDUCTS PROP_NEUTPENETRATE PROP_LIFE_DEC
 +
 +
Example:
 +
 +
<nowiki>{{ infobox Element
 +
| icon = ASDF.png
 +
| longname =
 +
| image =
 +
 +
| identifier = DEFAULT_PT_ASDF
 +
| name = ASDF
 +
| description = Very light dust. Flammable.
 +
| colour = FFE0A0
 +
| menusection = SC_POWDERS
 +
| menuvisible = 1
 +
| advection = 0.7
 +
| airdrag = 0.02
 +
| airloss = 0.96
 +
| loss = 0.8
 +
| collision = 0
 +
| diffusion = 0
 +
| explosive = 0
 +
| falldown = 1
 +
| flammable = 10
 +
| gravity = 0.1
 +
| hardness = 30
 +
| heatconduct = 70
 +
| hotair = 0
 +
| meltable = 0
 +
| state = ST_SOLID
 +
| temperature = 2564.15
 +
| weight = 85
 +
| properties = TYPE_PART PROP_LIFE_DEC PROP_LIFE_KILL_DEC
 +
| lowtemperature = 1234
 +
| lowtemperaturetransition = DUST
 +
| hightemperature = 5678
 +
| hightemperaturetransition = special
 +
| lowpressure =
 +
| lowpressuretransition =
 +
| highpressure =
 +
| highpressuretransition =
 +
}}</nowiki>
 +
 +
which gives
 +
 +
{{ infobox Element
 +
| icon = ASDF.png
 +
| longname =
 +
| image =
 +
 +
| identifier = DEFAULT_PT_ASDF
 +
| name = ASDF
 +
| description = Very light dust. Flammable.
 +
| colour = FFE0A0
 +
| menusection = SC_POWDERS
 +
| menuvisible = 1
 +
| advection = 0.7
 +
| airdrag = 0.02
 +
| airloss = 0.96
 +
| loss = 0.8
 +
| collision = 0
 +
| diffusion = 0
 +
| explosive = 0
 +
| falldown = 1
 +
| flammable = 10
 +
| gravity = 0.1
 +
| hardness = 30
 +
| heatconduct = 70
 +
| hotair = 0
 +
| meltable = 0
 +
| state = ST_SOLID
 +
| temperature = 2564.15
 +
| weight = 85
 +
| properties = TYPE_PART PROP_LIFE_DEC PROP_LIFE_KILL_DEC
 +
| lowtemperature = 1234
 +
| lowtemperaturetransition = DUST
 +
| hightemperature = 5678
 +
| hightemperaturetransition = special
 +
| lowpressure =
 +
| lowpressuretransition =
 +
| highpressure =
 +
| highpressuretransition =
 +
}}
 +
 
</noinclude>
 
</noinclude>

Revision as of 14:32, 6 October 2014

Infobox for displaying various element properties.

Most of them should be passed exactly as in the source code. However, the properties parameter should be space separated (so remove the pipes). Example: TYPE_LIQUID PROP_CONDUCTS PROP_NEUTPENETRATE PROP_LIFE_DEC

Example:

{{ infobox Element | icon = ASDF.png | longname = | image = | identifier = DEFAULT_PT_ASDF | name = ASDF | description = Very light dust. Flammable. | colour = FFE0A0 | menusection = SC_POWDERS | menuvisible = 1 | advection = 0.7 | airdrag = 0.02 | airloss = 0.96 | loss = 0.8 | collision = 0 | diffusion = 0 | explosive = 0 | falldown = 1 | flammable = 10 | gravity = 0.1 | hardness = 30 | heatconduct = 70 | hotair = 0 | meltable = 0 | state = ST_SOLID | temperature = 2564.15 | weight = 85 | properties = TYPE_PART PROP_LIFE_DEC PROP_LIFE_KILL_DEC | lowtemperature = 1234 | lowtemperaturetransition = DUST | hightemperature = 5678 | hightemperaturetransition = special | lowpressure = | lowpressuretransition = | highpressure = | highpressuretransition = }}

which gives

ASDF.png
Properties
Section Powders
Spawn temperature 2291°C
Heat Conductivity 28%
Relative weight 85
Gravity 0.1
Acid dissolve rate 3%
Flammability 10
State Powder
Transitions
Low temperature DUST.png below 960.85°C
High temperature transition occurs above 5404.85°C
Misc properties
Source code