Template:ShipInfobox: Difference between revisions

Conversion to portable infobox
m Reverted portable infobox until we get feature parity
Line 1: Line 1:
<infobox theme="portInfobox">
<onlyinclude>
<title><default>{{PAGENAME}}</default></title>
{{#infoboxbuilder:
<image source="image"><default>Placeholder.png</default></image>
| 0:Theme = eInfobox
<group>
| 0:CustomModule = Module:ShipInfobox
    <header>Overview</header>
 
    <data source="manufacturer"><label>Manufacturer</label><format>[[{{{manufacturer}}}]]</format></data>
| 1:Type = Title
    <data source="yearsproduced"><label>Years Produced</label></data>
| 1:Label = NULL
    <data source="type"><label>Type</label></data>
| 1:Value = {{PAGENAME}}
    <data source="cost">
 
        <label>Cost</label>
| 2:Type = MainImage
        <format>{{{cost}}} CR</format>
| 2:Label = NULL
        <!--
| 2:Value = [[File:{{{image|Placeholder.png}}}|306px]]
        TODO: strip commas in {{{cost}}} and reformat to use commas.
 
        FormatNum.commavalue(field.Value:gsub(',',''))
| 3:Type = Header
        -->
| 3:Label = NULL
    </data>
| 3:Value = Overview
    <data source="cost">
 
        <label>Insurance</label>
| 4:Type = Line
        <format>{{formatnum: {{#expr: trunc({{formatnum: {{{cost|}}}|R}}*0.05)}} }} CR</format>
| 4:Label = Manufacturer
            <!-- 5% of cost integer -->
| 4:Value = {{#if:{{{manufacturer|}}}|[[{{{manufacturer|}}}]]|}}
        </data>
 
    <data source="factionreq"><label>Faction</label><format>[[{{{factionreq}}}]]</format></data>
| 5:Type = Line
    <data source="factionrank">
| 5:Label = Years Produced
        <label>Faction Rank</label>
| 5:Value = {{{yearsproduced|}}}
        <format>{{#if: {{{factionreq|}}} | {{{factionrank}}} }}</format>
 
    </data>
| 6:Type = Line
    <data source="expansionreq"><label>Expansion</label></data>
| 6:Label = Type
    </group>
| 6:Value = {{{type|}}}
<group>
 
    <header>Default Specifications</header>
| 7:Type = Line
    <data source="landingpad"><label>Landing Pad Size</label></data>
| 7:Label = Cost
    <data source="dimensions"><label>Dimensions</label></data>
| 7:ValueMethod = FormatCost
    <data source="seats"><label>Pilot Seats</label></data>
| 7:Unit = CR
    <data source="multicrew"><label>Multicrew</label></data>
| 7:Value = {{{cost|}}}
    <data source="fighterhangar"><label>Fighter Hangar</label></data>
 
    <data source="hullmass"><label>Hull Mass</label><format>{{{hullmass}}} t</format></data>
| 8:Type = Line
    <data source="masslock"><label>Mass Lock Factor</label></data>
| 8:Label = Insurance
    <data source="armour"><label>Armour</label></data>
| 8:ValueMethod = Insurance
    <data source="armourhardness"><label>Armour Hardness</label></data>
| 8:Cost = {{{cost|}}}
    <data source="shields"><label>Shields</label><format>{{{shields}}} MJ</format>
| 8:Value = NULL
        <!--
 
        TODO: strip commas in {{{cost}}} and reformat to use commas.
| 9:Type  = Line
        FormatNum.commavalue(field.Value:gsub(',',''))
| 9:Label = Faction
        -->
| 9:Value = {{{factionreq|}}}
    </data>
| 9:ValueMethod = Factionreq
    <data source="manoeuvrability"><label>Manoeuvrability</label></data>
 
    <data source="topspeed"><label>Top Speed</label><format>{{{topspeed}}} m/s</format></data>
| 10:Type = Line
    <data source="boostspeed"><label>Boost Speed</label><format>{{{boostspeed}}} m/s</format></data>
| 10:Label = Faction Rank
    <data source="jumprange"><label>Unladen Jump Range</label><format>{{{jumprange}}} ly</format></data>
| 10:Value = {{{factionrank|}}}
    <data source="cargocapacity"><label>Cargo Capacity</label><format>{{{cargocapacity}}} t</format></data>
| 10:Requirement = {{{factionreq|}}}
    <data source="fuelcapacity"><label>Fuel Capacity</label><format>{{{fuelcapacity}}} t</format></data>
 
    <data>
| 11:Type  = Line
        <label>Hardpoints</label>
| 11:Label = Expansion
        <default>{{#if: {{{utility|}}} | {{{utility}}}× Utility {{plural: {{{utility}}} | Mount | Mounts}} <br/> }}{{#if: {{{small|}}} | {{{small}}}× Small {{plural: {{{small}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{medium|}}} | {{{medium}}}× Medium {{plural: {{{medium}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{large|}}} | {{{large}}}× Large {{plural: {{{large}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{huge|}}} | {{{huge}}}× Huge {{plural: {{{huge}}} | Hardpoint | Hardpoints}} <br/> }}</default>
| 11:Value = {{{expansionreq|}}}
        </data>
 
    <data><label>Internals</label><default>{{#if: {{{size1|}}} | {{{size1}}}× Size 1 {{plural: {{{size1}}} | Compartment | Compartments}} <br/> }}{{#if: {{{size2|}}} | {{{size2}}}× Size 2 {{plural: {{{size2}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size3|}}} | {{{size3}}}× Size 3 {{plural: {{{size3}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size4|}}} | {{{size4}}}× Size 4 {{plural: {{{size4}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size5|}}} | {{{size5}}}× Size 5 {{plural: {{{size5}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size6|}}} | {{{size6}}}× Size 6 {{plural: {{{size6}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size7|}}} | {{{size7}}}× Size 7 {{plural: {{{size7}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size8|}}} | {{{size8}}}× Size 8 {{plural: {{{size8}}} | Compartment | Compartments }} <br/> }}{{#if: {{{reservedic|}}} | {{{reservedic}}} }}</default>
| 12:Type = Header
        </data>
| 12:Label = NULL
    </group>
| 12:Value = Default Specifications
<group>
 
    <header>Maximum Non-Engineered Specs</header>
| 13:Type = Line
<data source="maxtopspeed"><label>Top Speed</label><format>{{{maxtopspeed}}} m/s</format></data>
| 13:Label = Landing Pad Size
<data source="maxboostspeed"><label>Top Boost</label><format>{{{maxboostspeed}}} m/s</format></data>
| 13:Value = {{{landingpad|}}}
<data source="maxjumprange"><label>Unladen Jump Range</label><format>{{{maxjumprange}}} ly</format></data>
 
<data source="maxcargocapacity"><label>Cargo Capacity</label><format>{{{maxcargocapacity}}} t</format><!-- TODO: Lua Function --></data>
| 14:Type = Line
</group>
| 14:Label = Dimensions
</infobox><noinclude>
| 14:Value = {{{dimensions|}}}
 
| 15:Type = Line
| 15:Label = Pilot Seats
| 15:Value = {{{seats|}}}
 
| 16:Type = Line
| 16:Label = Multicrew
| 16:Value = {{{multicrew|}}}
 
| 17:Type = Line
| 17:Label = Fighter Hangar
| 17:Value = {{{fighterhangar|}}}
 
| 18:Type = Line
| 18:Label = Hull Mass
| 18:ValueMethod = Quantify
| 18:Unit = t
| 18:Value = {{{hullmass|}}}
 
| 19:Type = Line
| 19:Label = Mass Lock Factor
| 19:Value = {{{masslock|}}}
 
| 20:Type = Line
| 20:Label = Armour
| 20:Value = {{{armour|}}}
 
| 21:Type = Line
| 21:Label = Armour Hardness
| 21:Value = {{{armourhardness|}}}
 
| 22:ValueMethod = FormatCost
| 22:Unit = MJ
| 22:Type = Line
| 22:Label = Shields
| 22:Value = {{{shields|}}}
 
| 23:Type = Line
| 23:Label = Manoeuvrability
| 23:Value = {{{manoeuvrability|}}}
 
| 24:Type = Line
| 24:Label = Top Speed
| 24:ValueMethod = Quantify
| 24:Unit = m/s
| 24:Value = {{{topspeed|}}}
 
| 25:Type = Line
| 25:Label = Boost Speed
| 25:ValueMethod = Quantify
| 25:Unit = m/s
| 25:Value = {{{boostspeed|}}}
 
| 26:Type = Line
| 26:Label = Unladen Jump Range
| 26:ValueMethod = Quantify
| 26:Unit = ly
| 26:Default = x
| 26:Value = {{{jumprange|}}}
 
| 27:Type = Line
| 27:Label = Cargo Capacity
| 27:ValueMethod = Quantify
| 27:Unit = t
| 27:Value = {{{cargocapacity|}}}
 
| 28:Type = Line
| 28:Label = Fuel Capacity
| 28:ValueMethod = Quantify
| 28:Unit = t
| 28:Value = {{{fuelcapacity|}}}
 
| 29:Type = Line
| 29:Label = Hardpoints
| 29:ValueMethod = Hardpoints
| 29:Utility = {{{utility|}}}
| 29:S = {{{small|}}}
| 29:M = {{{medium|}}}
| 29:L = {{{large|}}}
| 29:H = {{{huge|}}}
| 29:Value = NULL
 
| 30:Type = Line
| 30:Label = Internals
| 30:ValueMethod = Internals
| 30:S1 = {{{size1|}}}
| 30:S2 = {{{size2|}}}
| 30:S3 = {{{size3|}}}
| 30:S4 = {{{size4|}}}
| 30:S5 = {{{size5|}}}
| 30:S6 = {{{size6|}}}
| 30:S7 = {{{size7|}}}
| 30:S8 = {{{size8|}}}
| 30:Reserved = {{{reservedic|}}}
| 30:Value = NULL
 
| 31:Type = Header
| 31:Label = NULL
| 31:Value = Maximum Non-Engineered Specs
 
| 32:Type = Line
| 32:Label = Top Speed
| 32:ValueMethod = Quantify
| 32:Unit = m/s
| 32:Value = {{{maxtopspeed|}}}
 
| 33:Type = Line
| 33:Label = Boost Speed
| 33:ValueMethod = Quantify
| 33:Unit = m/s
| 33:Value = {{{maxboostspeed|}}}
 
| 34:Type = Line
| 34:Label = Unladen Jump Range
| 34:ValueMethod = Quantify
| 34:Unit = ly
| 34:Value = {{{maxjumprange|}}}
 
| 35:Type = Line
| 35:Label = Cargo Capacity
| 35:ValueMethod = MaxCargo
| 35:Unit = t
| 35:Cargo = {{{maxcargocapacity|}}}
| 35:S1 = {{{size1|}}}
| 35:S2 = {{{size2|}}}
| 35:S3 = {{{size3|}}}
| 35:S4 = {{{size4|}}}
| 35:S5 = {{{size5|}}}
| 35:S6 = {{{size6|}}}
| 35:S7 = {{{size7|}}}
| 35:S8 = {{{size8|}}}
| 35:Value = {{{maxcargocapacity|}}}{{{size1|}}}{{{size2|}}}{{{size3|}}}{{{size4|}}}{{{size5|}}}{{{size6|}}}{{{size7|}}}{{{size8|}}}
}}</onlyinclude>
<noinclude>
The blank version of this template is as follows:
The blank version of this template is as follows:
<pre style="width: 300px">
<pre style="width: 300px">
Line 110: Line 244:
| maxjumprange        =  
| maxjumprange        =  
}}
}}
</pre></noinclude>
</pre>
</noinclude>