Jump to content

Template:ShipInfobox: Difference between revisions

From Elite Dangerous Wiki
Undo revision 124740 by Emptylord (talk) That used an outdated draft, there were subsequent changes made to this template.
Conversion to portable infobox
Line 1: Line 1:
<onlyinclude>
<infobox theme="portInfobox">
{{#infoboxbuilder:
<title><default>{{PAGENAME}}</default></title>
| 0:Theme = eInfobox
<image source="image"><default>Placeholder.png</default></image>
| 0:CustomModule = Module:ShipInfobox
<group>
 
    <header>Overview</header>
| 1:Type = Title
    <data source="manufacturer"><label>Manufacturer</label><format>[[{{{manufacturer}}}]]</format></data>
| 1:Label = NULL
    <data source="yearsproduced"><label>Years Produced</label></data>
| 1:Value = {{PAGENAME}}
    <data source="type"><label>Type</label></data>
 
    <data source="cost">
| 2:Type = MainImage
        <label>Cost</label>
| 2:Label = NULL
        <format>{{{cost}}} CR</format>
| 2:Value = [[File:{{{image|Placeholder.png}}}|306px]]
        <!--
 
        TODO: strip commas in {{{cost}}} and reformat to use commas.
| 3:Type = Header
        FormatNum.commavalue(field.Value:gsub(',',''))
| 3:Label = NULL
        -->
| 3:Value = Overview
    </data>
 
    <data source="cost">
| 4:Type = Line
        <label>Insurance</label>
| 4:Label = Manufacturer
        <format>{{formatnum: {{#expr: trunc({{formatnum: {{{cost|}}}|R}}*0.05)}} }} CR</format>
| 4:Value = {{#if:{{{manufacturer|}}}|[[{{{manufacturer|}}}]]|}}
            <!-- 5% of cost integer -->
 
        </data>
| 5:Type = Line
    <data source="factionreq"><label>Faction</label><format>[[{{{factionreq}}}]]</format></data>
| 5:Label = Years Produced
    <data source="factionrank">
| 5:Value = {{{yearsproduced|}}}
        <label>Faction Rank</label>
 
        <format>{{#if: {{{factionreq|}}} | {{{factionrank}}} }}</format>
| 6:Type = Line
    </data>
| 6:Label = Type
    <data source="expansionreq"><label>Expansion</label></data>
| 6:Value = {{{type|}}}
    </group>
 
<group>
| 7:Type = Line
    <header>Default Specifications</header>
| 7:Label = Cost
    <data source="landingpad"><label>Landing Pad Size</label></data>
| 7:ValueMethod = FormatCost
    <data source="dimensions"><label>Dimensions</label></data>
| 7:Unit = CR
    <data source="seats"><label>Pilot Seats</label></data>
| 7:Value = {{{cost|}}}
    <data source="multicrew"><label>Multicrew</label></data>
 
    <data source="fighterhangar"><label>Fighter Hangar</label></data>
| 8:Type = Line
    <data source="hullmass"><label>Hull Mass</label><format>{{{hullmass}}} t</format></data>
| 8:Label = Insurance
    <data source="masslock"><label>Mass Lock Factor</label></data>
| 8:ValueMethod = Insurance
    <data source="armour"><label>Armour</label></data>
| 8:Cost = {{{cost|}}}
    <data source="armourhardness"><label>Armour Hardness</label></data>
| 8:Value = NULL
    <data source="shields"><label>Shields</label><format>{{{shields}}} MJ</format>
 
        <!--
| 9:Type  = Line
        TODO: strip commas in {{{cost}}} and reformat to use commas.
| 9:Label = Faction
        FormatNum.commavalue(field.Value:gsub(',',''))
| 9:Value = {{{factionreq|}}}
        -->
| 9:ValueMethod = Factionreq
    </data>
 
    <data source="manoeuvrability"><label>Manoeuvrability</label></data>
| 10:Type = Line
    <data source="topspeed"><label>Top Speed</label><format>{{{topspeed}}} m/s</format></data>
| 10:Label = Faction Rank
    <data source="boostspeed"><label>Boost Speed</label><format>{{{boostspeed}}} m/s</format></data>
| 10:Value = {{{factionrank|}}}
    <data source="jumprange"><label>Unladen Jump Range</label><format>{{{jumprange}}} ly</format></data>
| 10:Requirement = {{{factionreq|}}}
    <data source="cargocapacity"><label>Cargo Capacity</label><format>{{{cargocapacity}}} t</format></data>
 
    <data source="fuelcapacity"><label>Fuel Capacity</label><format>{{{fuelcapacity}}} t</format></data>
| 11:Type  = Line
    <data>
| 11:Label = Expansion
        <label>Hardpoints</label>
| 11:Value = {{{expansionreq|}}}
        <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>
 
        </data>
| 12:Type = Header
    <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:Label = NULL
        </data>
| 12:Value = Default Specifications
    </group>
 
<group>
| 13:Type = Line
    <header>Maximum Non-Engineered Specs</header>
| 13:Label = Landing Pad Size
<data source="maxtopspeed"><label>Top Speed</label><format>{{{maxtopspeed}}} m/s</format></data>
| 13:Value = {{{landingpad|}}}
<data source="maxboostspeed"><label>Top Boost</label><format>{{{maxboostspeed}}} m/s</format></data>
 
<data source="maxjumprange"><label>Unladen Jump Range</label><format>{{{maxjumprange}}} ly</format></data>
| 14:Type = Line
<data source="maxcargocapacity"><label>Cargo Capacity</label><format>{{{maxcargocapacity}}} t</format><!-- TODO: Lua Function --></data>
| 14:Label = Dimensions
</group>
| 14:Value = {{{dimensions|}}}
</infobox><noinclude>
 
| 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 244: Line 110:
| maxjumprange        =  
| maxjumprange        =  
}}
}}
</pre>
</pre></noinclude>
</noinclude>

Revision as of 09:15, 30 August 2019

The blank version of this template is as follows:

{{ShipInfobox
| image               = 
| manufacturer        = 
| yearsproduced       = 
| type                = 
| cost                = 
| factionreq          = 
| factionrank         = 
| expansionreq        = 
| landingpad          = 
| dimensions          = 
| seats               = 
| multicrew           = 
| fighterhangar       = 
| hullmass            = 
| masslock            = 
| armour              = 
| armourhardness      = 
| shields             = 
| manoeuvrability     = 
| topspeed            = 
| boostspeed          = 
| jumprange           = 
| cargocapacity       = 
| fuelcapacity        = 
| utility             = 
| small               = 
| medium              = 
| large               = 
| huge                = 
| size1               = 
| size2               = 
| size3               = 
| size4               = 
| size5               = 
| size6               = 
| size7               = 
| size8               = 
| reservedic          = 
| maxtopspeed         = 
| maxboostspeed       = 
| maxjumprange        = 
}}