Difference between revisions of "Template:Infobox/Resource"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Parameters)
(Move translations to Dict, Add Tweakable and Drainable parameter, Move info to doc template,)
Line 1: Line 1:
{{Infobox
+
<includeonly>{{Infobox
|name={{{name|}}}
+
|name={{Dict/resource|{{{name|{{BASEPAGENAME}}}}}}}
 
|file={{{file|none}}}
 
|file={{{file|none}}}
|subtitle={{{subtitle|}}}
 
 
|icon={{{icon|}}}
 
|icon={{{icon|}}}
 
|icon width={{{icon width|}}}
 
|icon width={{{icon width|}}}
 
|lines=
 
|lines=
 
{{#if: {{{file desc|}}}|{{#if: {{{file|}}}|{{Infobox/Line|style=text-align:center; font-size:smaller;|{{{file desc|}}}}}}}}}
 
{{#if: {{{file desc|}}}|{{#if: {{{file|}}}|{{Infobox/Line|style=text-align:center; font-size:smaller;|{{{file desc|}}}}}}}}}
{{Infobox/Line|{{lang|en=Density|de=Dichte|fr=Densité|pl=Gęstość|hu=Sűrűség|ru=Плотность|ja=密度|it=Densità|tr=Yoğunluk}}|2={{#ifexpr: {{{density<noinclude>|5</noinclude>}}}|{{{density<noinclude>|5</noinclude>}}}&nbsp;{{dict|k}}{{dict|g}}/{{Unit|{{{unit|l}}}}}|{{lang|en=None|de=Keine|fr=Aucun|pl=Brak|hu=Nincs|ru=Нет|ja=無し|it=Nessuna|tr=Yok}}}}}}
+
{{Infobox/Line|{{Infobox/Resource/Dict|Density}}|{{#ifexpr: {{{density}}}|{{{density}}}&nbsp;{{Dict|k}}{{Dict|g}}/{{Unit|{{{unit|l}}}}}|{{Dict|None}}}}}}
{{Infobox/Line|{{lang|en=Transferable|de=Transferierbar|fr=Transférable|pl=Transportowalne|hu=Áthelyezhető|ru=Передаваемый|ja=他機との受給|it=Trasferibile|tr=Transfer edilebilir}}|{{#ifeq: {{{transfer}}}|N|{{No}}|{{Yes}}}}}}
+
{{Infobox/Line|{{Infobox/Resource/Dict|Transferable}}|{{#ifeq: {{lc:{{{transfer|}}}}}|n|{{No}}|{{Yes}}}}}}
{{Infobox/Line|{{lang|en=[[Resource#Flow modes|Flow mode]]|de=Flussmodus|fr=[[Resource/fr#Flow modes|Mode de transfert]]|pl=Tryb przepływu|hu=Áramlás módja|ru=Способ истечения|ja=[[Resource/ja#機内供給の性質|機内供給]]|it=Modalità Flusso|tr=[[Resource/tr#Akış modları|Akış modu]]}}|{{#switch: {{{flow}}}
+
{{Infobox/Line|{{Infobox/Resource/Dict|Tweakable}}|{{#ifeq: {{lc:{{{tweakable|}}}}}|n|{{No}}|{{Yes}}}}}}
|a={{lang|en=Adjacent|de=Benachbart|pl=Sąsiadujący|hu=Szomszédos|ru=Смежный|ja=隣接部のみ|it=Adiacente|tr=Bitişiğe}}
+
{{Infobox/Line|{{Infobox/Resource/Dict|Drainable}}|{{#ifeq: {{lc:{{{drainable|}}}}}|n|{{No}}|{{Yes}}}}}}
|e={{lang|en=Everywhere|de=Überall|fr=Partout|pl=Wszędzie|hu=Bárhová|ru=Везде|ja=機体全体|it=Ovunque|tr=Her yere}}
+
{{Infobox/Line|{{Infobox/Resource/Dict|Flow Mode}}|{{#switch: {{lc:{{{flow}}}}}
|i={{lang|en=Internal|de=Intern|fr=Interne|pl=Wewnętrzny|hu=Belül|ru=Внутренний|ja=自己消費|it=Interno|tr=Kendisine}}
+
|a={{Infobox/Resource/Dict|Adjacent}}
|n={{lang|en=None|fr=Aucun|tr=Hiçbir yere}}
+
|e={{Infobox/Resource/Dict|Everywhere}}
|#default=<span class="error" style="white-space:normal;">{{lang|en=Invalid flow mode|de=Ungültiger Flussmodus|fr=Mode de transfert invalide|pl=Nieprawidłowy tryb przepływu|hu=Érvénytelen|ru=Неизвестный способ истечения|tr=Geçersiz akış modu}}</span>}}}}
+
|i={{Infobox/Resource/Dict|Internal}}
{{Infobox/Line|{{Dict|Cost}}|{{#ifexpr: {{{cost<noinclude>|0.8</noinclude>}}}|{{{cost<noinclude>|0.8</noinclude>}}}&nbsp;{{mark|fund}}/{{Unit|{{{unit|l}}}}}|{{lang|en=None|de=Keine|fr=Aucun|pl=Brak|hu=Nincs|ru=Нет|it=Nessuno|tr=Yok}}}}|{{#ifexpr: {{{cost<noinclude>|0.8</noinclude>}}}*{{{density<noinclude>|5</noinclude>}}}|{{#expr: {{{cost<noinclude>|0.8</noinclude>}}}/{{{density<noinclude>|5</noinclude>}}} round 2}}&nbsp;{{mark|fund}}/{{dict|k}}{{dict|g}}}}}}
+
|n={{Dict|None}}
 +
|#default=<span class="error" style="white-space:normal;">{{Infobox/Resource/Dict|Invalid}}</span>}}}}
 +
{{Infobox/Line|{{Dict|Cost}}|{{#ifexpr: {{{cost}}}|{{{cost}}}&nbsp;{{Mark|fund}}/{{Unit|{{{unit|l}}}}}|{{Dict|None}}}}|{{#ifexpr: {{{cost}}}*{{{density}}}|{{#expr: {{{cost}}}/{{{density}}} round 2}}&nbsp;{{Mark|fund}}/{{Dict|k}}{{Dict|g}}}}}}
 
{{Infobox/Line|{{Dict|Since}}|{{#if: {{{since|}}}|{{version|{{{since}}}|}}|{{Dict|Unknown}}}}}}
 
{{Infobox/Line|{{Dict|Since}}|{{#if: {{{since|}}}|{{version|{{{since}}}|}}|{{Dict|Unknown}}}}}}
}}<noinclude>Infobox for [[resource]]s.
+
}}</includeonly><noinclude>
 
+
{{Documentation}}
== Parameters ==
+
</noinclude>
{{Parameter table|name=text|parameters=
 
{{Parameter row|name|Name of the resource.|<tt><nowiki>{{BASEPAGENAME}}</nowiki></tt>}}
 
{{Parameter row|file|Image of the resource.|Not shown (<tt>none</tt>)}}
 
{{Parameter row|file desc|Description of the image.|Not shown (Hidden)|1}}
 
{{Parameter row|density|Density of the resource in kg/{{{unit}}}. Allows <tt>0</tt> for ''None'' and without unit.}}
 
{{Parameter row|transfer|If this resource is transferable. Allows <tt>N</tt> for {{tl|No}} and shows {{tl|Yes}} for every other value.|{{Yes}}}}
 
{{Parameter row|flow|The [[Resource#Flow%20modes|flow mode]] of the resource.}}
 
{{Parameter row|cost|Cost per unit of the resource. Allows <tt>0</tt> for ''None'' and without unit. Also calculates costs per mass if density and cost are both not zero.}}
 
{{Parameter row|since|The introduction of this resource. If not set shows the value unknown.|Not set (Unknown)}}
 
{{Parameter row|unit|The unit of volume for the density.|<tt>l</tt>}}
 
}}
 
 
 
=== Flow modes ===
 
{| class="wikitable"
 
! Code
 
! Type
 
! Description
 
|-
 
| a
 
| Adjacent
 
| Resources will only flow between adjacent sources and sinks, meaning that tanks can be drained unevenly.
 
|-
 
| e
 
| Everywhere
 
| The resource is always available to all parts structurally connected to the vessel, and the same amount of resources is drained from every container.
 
|-
 
| i
 
| Internal
 
| The resource can only be used by the part containing it.
 
|-
 
| n
 
| None
 
| The resource won't be pumped automatically but can be manually transferred.
 
|}
 
 
 
[[Category:Infobox templates]]</noinclude>
 

Revision as of 21:40, 27 July 2021

Documentation icon Template documentation[view] [edit] [history] [purge]Pages that link to Template:Infobox/Resource
Infobox
Density 5 kg/l
Transferable No
Tweakable Yes
Drainable No
Flow mode Adjacent
Cost 0.8 Funds/l
0.16 Funds/kg
Since version 0.20

Infobox for resources.

Parameters

Name Optional Description Default
name Yes Name of the resource. {{BASEPAGENAME}}
icon Yes Icon of the resource. Not set/Hidden
icon width Yes Width of the image. Not set/Hidden
density No Density of the resource in kg/{{{unit}}}. Allows 0 for None and without unit.
transfer Yes Whether the resource is transferable. Allows y for {{Yes}} and shows {{No}} for every other value. No
tweakable Yes Whether the resource is tweakable in the VAB/SPH. Allows y for {{Yes}} and shows {{No}} for every other value. No
drainable Yes Whether the resource is drainable. Allows n for {{No}} and shows {{Yes}} for every other value. Yes
flow No The flow mode of the resource.
cost No Cost per unit of the resource. Allows 0 for None and without unit. Also calculates costs per mass if density and cost are both not zero.
since Yes The introduction of this resource. If not set shows the value unknown. Unknown
unit Yes The unit of volume for the density. l

Flow modes

Code Type Description
a Adjacent Resources will only flow between adjacent sources and sinks, meaning that tanks can be drained unevenly.
e Everywhere The resource is always available to all parts structurally connected to the vessel, and the same amount of resources is drained from every container.
i Internal The resource can only be used by the part containing it.
n None The resource won't be pumped automatically but can be manually transferred.