Difference between revisions of "Template:SimpleItembox"

From Space Engineers Wiki
Jump to: navigation, search
(New Itembox that can (eventually) be used to display block/item by referencing a different page.)
 
m (More icons)
 
(66 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Under Construction}}
+
<includeonly>{{#if:{{{1|}}}||'''SimpleItembox Error:''' Missing ''Page'' parameter!}}<!--
 
+
--><div style="background:#b2d5e8; {{{style|margin: 0.25em 0.25em 0.25em 1em; position:relative; width:350px; float:right; clear:right;}}}"><!--
Display the info box "Itembox" of an item from a different page.
+
HEADER
 
+
  --><div style="background:#486d82; padding: 0.25em; color:white; text-shadow:0px 0px 0.40em black;font-family:Arial;><!--
<pre>Usage: {{SimpleItemBox|ItemStatPage|Label|Language code}}
+
BLOCK HEADER
 
+
    --><div style="display: flex; flex-direction: row; justify-content: space-between; text-align: center; margin-bottom: 0.25em; overflow-wrap: anywhere"><!--
ItemStatPage - The page holding the block/item's stats.
+
      -->[[File:{{#show:{{{1}}}|?Icon#-|default=Icon Template.png}}|48px]]<!--
Label - The (translated) header text.
+
      --><div><!--
Language code - Optional. Language to use in the itembox.</pre>
+
        --><span style="font-size:0.75em"><!--
Example usage:
+
          -->{{Componentbox/{{#switch: {{#show:{{{1}}}|?TypeId#-}}
 
+
            | Component = Component
<code><nowiki>{{SimpleItemBox|SmallHydrogenTankSmall|Small Hydrogen Tank}}</nowiki></code> for the Small small-block hydrogen tank in english.
+
            | MyObjectBuilder_AngleGrinder
{{SimpleItemBox|SmallHydrogenTankSmall|Small Hydrogen Tank}}
+
            | MyObjectBuilder_HandDrill
 
+
            | MyObjectBuilder_Welder
<code><nowiki>{{SimpleItemBox|SmallHydrogenTankSmall|Liten Vätgastank|sv}}</nowiki></code> for the same block in Swedish.
+
            | MyObjectBuilder_AutomaticRifle = Tool
{{SimpleItemBox|SmallHydrogenTankSmall|Liten Vätgastank|sv}}
+
            | Ore = Raw Material
 
+
            | Ingot = Material
----
+
            | PhysicalObject = Item
<onlyinclude><!--
+
            | #default = {{#switch: {{#show:{{{1}}}|?CubeSize#-}}
--><div style="position:relative; width:350px; float:right; border:1px solid black;"><!-- The Main box
+
              | Large=Large Ship / Station
  --><div style="background:#486d82; background:#486d82; padding:0.25em; display: flex; flex-direction: row;"><!-- Header Start
+
              | Small=Small Ship
    --><div style="flex-grow: 0;"><!--
+
              | #default=Item
       -->[[File:{{#show: {{{1|SmallHydrogenTankSmall}}}|?Icon#-}}|48px]]<!--
+
            }}}}{{lang}}}}<!--
 +
        --></span><br/><!--
 +
        --><span style="font-size:2em; line-height:normal"><!--
 +
          -->{{#if: {{lang}} | {{{{trim|{{{1}}}}}{{lang}}}} | {{#show: {{{1}}}|?Translation|default={{{1}}} has an empty or missing ''Translation'' parameter!}}}}<!--
 +
        --></span><!--
 +
      --></div><!--
 +
       -->[[File: {{#switch: {{#show:{{{1}}}|?TypeId#-}}
 +
        | Component = Component Icon.png
 +
        | Ingot = Material Icon.png
 +
        | Ore = Raw Icon.png
 +
        | MyObjectBuilder_AngleGrinder
 +
        | MyObjectBuilder_HandDrill
 +
        | MyObjectBuilder_Welder
 +
        | MyObjectBuilder_AutomaticRifle = Tool Icon.png
 +
        | #default = {{#switch: {{#show:{{{1}}}|?CubeSize#-}}
 +
          | Large=Large Ship Icon.png
 +
          | Small=Small Ship Icon.png
 +
          | #default=Icon Template.png
 +
        }}}}|48px]]<!--
 
     --></div><!--
 
     --></div><!--
     --><div style="color:white; font-size:2em; text-shadow:0px 0px 0.40em rgba(0,0,0,1); font-family:Arial; height:auto; flex-grow:1; text-align:center"><!--
+
BLOCK HEADER END
       -->{{{2}}}<!--
+
COMPONENTS HEADER
     --></div><!--
+
     -->{{#if: {{#show: {{{1}}}|?Component1#-}}|<!--
     --><div style="flex-grow: 0;"><!--
+
      --><hr style="height: 3px; background-color: #659bb7"/><!--
       -->[[File: {{#switch: {{#show:{{{1|SmallHydrogenTankSmall}}}|?SimpleItemboxType#-}}
+
      --><div style="font-size:1.2em; display: flex; justify-content: space-between;"><!--
          | Block = {{#ifeq: {{#show:{{{1|SmallHydrogenTankSmall}}}|?CubeSize}} | Large | Large Ship Icon.png | Small Ship Icon.png}}
+
        --><span>{{Componentbox/Components{{lang}}}}</span><!--
          | Component = Component Icon.png
+
        --><span>{{Componentbox/Required{{lang}}}}</span><!--
          | Tool = Tool Icon.png
+
      --></div><!--
          | Ingot Material Icon.png
+
    -->}}<!--
          | Ore = Raw Icon.png
+
COMPONENTS HEADER END
          | #default = Icon Template.png}}|48px]]<!--
+
  --></div><!--
    --></div><!--
+
HEADER END
   --></div><!-- Header End
+
COMPONENTS START
   --><div><!-- Component box
+
  -->{{#if: {{#show: {{{1}}}|?Component1}}|<!--
  -->test<!--
+
  --><div style="display: flex; flex-direction: column; margin: 0.25em;"><!--
 +
FUNCTIONAL LINE
 +
    -->{{#ifexpr: {{#vardefineecho:CriticalComponentIndex|{{#show: {{{1}}}|?CriticalComponent#-|default=1}}}} > 1|<!--
 +
      --><div style="order:{{#var:CriticalComponentIndex}}; display: flex; align-items: center; max-height: 2px"><!--
 +
        --><hr style="height: 2px; background-color: #9c0c0c; flex-grow: 1"/><!--
 +
        --><span style="font-size: 0.75em">&nbsp;{{SimpleItembox/Functional{{lang}}}}&nbsp;</span><!--
 +
        --><hr style="height: 2px; background-color: #9c0c0c; flex-grow: 1"/><!--
 +
       --></div><!--
 +
    -->}}<!--
 +
FUNCTIONAL LINE END
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|1}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|2}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|3}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|4}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|5}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|6}}<!--
 +
     -->{{SimpleItembox/ComponentRow|{{{1}}}|7}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|8}}<!--
 +
    -->{{SimpleItembox/ComponentRow|{{{1}}}|9}}<!--
 +
     -->{{SimpleItembox/ComponentRow|{{{1}}}|10}}<!-- No block has more than 9 components at this time.
 +
  --></div><!--
 +
  --><hr style="height: 3px; background-color: #659bb7; margin: 0.25em"/>|}}<!--
 +
COMPONENTS END
 +
PROPERTIES
 +
  --><div>{{#vardefine:altrowcolor|#c2e5f8}}<!--
 +
    -->{{#if: {{{3|}}}|<!-- New Behavior (Property1#Unit1|Property2#Unit2...)
 +
      -->{{#if: {{{2|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{2}}}}}}}<!--
 +
      -->{{#if: {{{3|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{3}}}|color={{#var:altrowcolor}}}}}}<!--
 +
       -->{{#if: {{{4|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{4}}}}}}}<!--
 +
      -->{{#if: {{{5|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{5}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{6|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{6}}}}}}}<!--
 +
      -->{{#if: {{{7|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{7}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{8|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{8}}}}}}}<!--
 +
      -->{{#if: {{{9|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{9}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{10|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{10}}}}}}}<!--
 +
      -->{{#if: {{{11|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{11}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{12|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{12}}}}}}}<!--
 +
      -->{{#if: {{{13|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{13}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{14|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{14}}}}}}}<!--
 +
      -->{{#if: {{{15|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{15}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{16|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{16}}}}}}}<!--
 +
      -->{{#if: {{{17|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{17}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{18|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{18}}}}}}}<!--
 +
      -->{{#if: {{{19|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{19}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{20|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{20}}}}}}}<!--
 +
    -->|<!-- Old behavior (Property1|Unit1|Property2...)
 +
      -->{{#if: {{{2|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{2}}}|{{{3|}}}}}}}<!--
 +
      -->{{#if: {{{4|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{4}}}|{{{5|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{6|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{6}}}|{{{7|}}}}}}}<!--
 +
      -->{{#if: {{{8|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{8}}}|{{{9|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{10|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{10}}}|{{{11|}}}}}}}<!--
 +
      -->{{#if: {{{12|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{12}}}|{{{13|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{14|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{14}}}|{{{15|}}}}}}}<!--
 +
      -->{{#if: {{{16|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{16}}}|{{{17|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{18|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{18}}}|{{{19|}}}}}}}<!--
 +
      -->{{#if: {{{20|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{20}}}|{{{21|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{22|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{22}}}|{{{23|}}}}}}}<!--
 +
      -->{{#if: {{{24|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{24}}}|{{{25|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{26|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{26}}}|{{{27|}}}}}}}<!--
 +
      -->{{#if: {{{28|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{28}}}|{{{29|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{30|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{30}}}|{{{31|}}}}}}}<!--
 +
      -->{{#if: {{{32|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{32}}}|{{{33|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{34|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{34}}}|{{{35|}}}}}}}<!--
 +
      -->{{#if: {{{36|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{36}}}|{{{37|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
      -->{{#if: {{{38|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{38}}}|{{{39|}}}}}}}<!--
 +
      -->{{#if: {{{40|}}}|{{SimpleItembox/PropertyRow|{{{1}}}|{{{40}}}|{{{41|}}}|color={{#var:altrowcolor}}}}}}<!--
 +
    -->}}<!--
 +
   --></div><!--
 +
PROPERTIES END
 +
   --><div style="display: flex; justify-content: space-between; background:#486d82; padding:0.25em; text-shadow:0px 0px 0.40em black; font-size:0.75em; padding: 0.25em 0.5em"><!--
 +
    -->[[Special:Browse/{{trim|{{{1}}}}}|<span style="color: white">{{SimpleItembox/Browse{{lang}}}}</span>]]<!--
 +
    --><span style="color:white;">{{SimpleItembox/Last edit{{lang}}}}: {{#time:Y-m-d|{{REVISIONTIMESTAMP:{{{1}}}}}}}</span><!--
 
   --></div><!--
 
   --></div><!--
--></div></onlyinclude>
+
--></div></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>

Latest revision as of 23:11, 20 May 2020

Displays an info box for a specific item.

Old Usage: 
{{SimpleItembox|Page|Prop1|Unit1|Prop2|Unit2|...}}

New Usage: 
{{SimpleItembox|Page|Prop1<#Unit1>|Prop2<#Unit2>|...}}

Page - The page holding the object's stats.
Prop1 - The first property to display.
Unit1 - The unit to display the first property in.
Prop2 - The second property to display.
Unit2 - The unit to display the second property in.
etc...

Examples:

{{SimpleItembox
|Mod:Vanilla/Ore/Uranium
|Mass||Volume#L|RefineTime|RefineAmount|MinimalPricePerUnit
}}
Uranium Ore Icon.png
Raw Material
Uranium Ore
Raw Icon.png
Mass1 kg
1,000 g
1,000,000 mg
1.0e-3 t
Volume0.37 L
3.7e-4 m³
2.368e-5 Large-Blocks
0.00296 Small-Blocks
0.037 hL
370 mL
Refine Time4 s
Refined Mass0.01 kg
10 g
10,000 mg
Minimum Price500 SC
BrowseLast edit: 2020-04-24
{{SimpleItembox
|Mod:Vanilla/Ingot/Iron
|Mass|Volume#L|BaseProductionTimeInSeconds
}}
Iron Ingot Icon.png
Material
Iron Ingot
Material Icon.png

ComponentsRequired

Mass1 kg
1,000 g
1,000,000 mg
1.0e-3 t
Volume0.127 L
1.27e-4 m³
8.128e-6 Large-Blocks
0.00102 Small-Blocks
0.0127 hL
127 mL
Base Production Time0.05 s
BrowseLast edit: 2020-05-18
{{SimpleItembox
|Mod:Vanilla/Component/SteelPlate
|Mass|Health|MaxIntegrity|Volume|BaseProductionTimeInSeconds
}}
Steel Plate Icon.png
Component
Steel Plate
Component Icon.png

ComponentsRequired

Mass20 kg
20,000 g
20,000,000 mg
0.02 t
Health53
Integrity100
Volume0.003 m³
3 L
1.92e-4 Large-Blocks
0.024 Small-Blocks
0.3 hL
3,000 mL
Base Production Time1 s
BrowseLast edit: 2021-02-04
{{SimpleItembox
|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall
|Size|Volume#{{m3}}|Mass#g|Integrity|BuildTimeSeconds|OperationalPowerConsumption|StandbyPowerConsumption|GasCapacity|IsAirTight|InventoryVolume#L|ResourceSinkGroup|PCU
}}
Small Hydrogen Tank Icon.png
Small Ship
Small Hydrogen Tank
Small Ship Icon.png

ComponentsRequired

 Functional 

 Hack 

Dimensions (W,H,L)2,2,1
Volume0.5 m³
500 L
0.032 Large-Blocks
4 Small-Blocks
50 hL
500,000 mL
Mass109,800 g
109.8 kg
109,800,000 mg
0.11 t
Integrity454
Build time12 s
Power Consumption200 W
0.2 kW
2.0e-4 MW
Idle Power Consumption0.2 W
2.0e-4 kW
2.0e-7 MW
Gas Capacity15,000 L
1,500 hL
15 m³
Is AirtightYes
Inventory Volume120 L
0.12 m³
12 hL
Power Consumer GroupFactory
PCU Cost25
BrowseLast edit: 2020-11-25