Difference between revisions of "Template:Infobox machine"

From Captain of Industry Wiki
Jump to: navigation, search
(Created page with "<includeonly><!-- --><div style="float:right; clear: right;"><!-- --><div style="display:inline-block; min-width: 250px; max-width: 350px; border: 3px solid rgba(252,162,58,1); border-radius: 15px; margin:10px; font-size:14px; background-color: rgba(46,46,46,1);"><!-- --><div style="width: 100%; vertical-align: middle; text-align: center; background-color: rgba(0,0,0,1); font-size: 20px; color: rgba(252,162,58,1); text-shadow: 0 0 10px rgba(255,162,58,.7); font-family:...")
 
m (Rename some categories)
 
(94 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><templatestyles src="Template:Infobox material/styles.css" /><!--
--><div style="float:right; clear: right;"><!--
--><div class="infobox-wrapper"><!--
--><div style="display:inline-block; min-width: 250px; max-width: 350px; border: 3px solid rgba(252,162,58,1); border-radius: 15px; margin:10px; font-size:14px; background-color: rgba(46,46,46,1);"><!--
--><div class="outer-box"><!--
  --><div style="width: 100%; vertical-align: middle; text-align: center; background-color: rgba(0,0,0,1); font-size: 20px; color: rgba(252,162,58,1); text-shadow: 0 0 10px rgba(255,162,58,.7); font-family: Georgia, Liberation Serif, Times, serif; border-radius: 15px 15px 0 0; border-bottom: 3px solid rgba(252,162,58,1); padding: 10px 0;"><!--
 
        -->{{#if: {{{Name|}}} | {{{Name}}} | Unknown Machine}}<!--
  ** Header: designation image, name of machine, tier **
  --><div class="inner-header"><!--
    --><div class="designation"><!--
      -->{{#if: {{{DesigImgOverride|}}} | <!--
        -->[[File:{{{DesigImgOverride}}}{{!}}48x48px{{!}}link=Category:{{{Designation|}}}]]|<!--
        -->{{#if: {{{Designation|}}} | <!--
            -->[[File:{{{Designation}}}.png{{!}}48x48px{{!}}link=Category:{{{Designation|}}}]]<!--
        -->}}<!--
      -->}}<!--
    --></div><!--
    --><div class="title"><!--
      -->{{#if: {{{Name|}}}<!--
        -->| {{#vardefineecho:info_bldg|{{{Name}}}}}<!--
          -->{{#vardefine:hidebldg|yes}}<!--
          ** This variable is used in footer template **
          -->{{#vardefine:game_object_type|building}}<!--
        -->| Unknown Machine }}<!--
    --></div><!--
    --><div class="tier"><!--
      -->{{#if: {{{Tier|}}} | T{{{Tier}}} }}<!--
    --></div><!--
   --></div><!--
   --></div><!--
   --><div style="text-align: center; padding: 10px 10px 0;"><!--
 
    -->{{#if: {{{Description|}}} | <!--
   ** Image of machine **
      --><div style="font-size:16px; color: rgba(255,255,255,1); padding: 0px 0px 10px 0px;">''“{{{Description}}}”''</div><!--
  --><div class="inner-main"><!--
    -->}}<!--
     -->[[File:{{#if: {{{Image|}}} | {{{Image}}} | {{#if: {{{Name|}}} | {{{Name}}} | Placeholder machine}}.png}}]]<br/><!--
     -->[[File:{{#if: {{{Image|}}} | {{{Image}}} | {{#if: {{{Name|}}} | {{{Name}}} | Placeholder machine}}.png}}]]<br/><!--
    -->{{#if: {{{Description|}}} | {{#ifeq: {{lc:{{{Description}}}}} | none |  |<!--
      --><div class="description">{{{Description}}}</div> |<!--
      -->{{#if: {{NAMESPACE}} || {{#ifeq: {{lc:{{{Designation|}}}}} | transports || [[Category:Machine articles missing descriptions]] }} }}<!--
    -->}}}}<!--
   --></div><!--
   --></div><!--
   --><div style="padding: 10px;"><!--
 
     --><div style="vertical-align:top; width: 100%;"><!--   
 
       --><table style="border-collapse: collapse; border-spacing: 0 8px; flex-grow:1; line-height:16px; white-space:nowrap; width: 100%"><!--
   --><div class="inner-table"><!--
     --><div class="inner-inner-table"><!--   
       --><table class="table"><!--
 
        ** Recipe for constructing building **
        -->{{#if:{{{Recipe|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Construction</td><!--
            --><td class="table-td-right">{{{Recipe}}}</td><!--
          --></tr>}}<!--
 
 
        ** Worker, Electricity, Computing, Unity **
         -->{{#if:{{{Workers|}}}|<!--
         -->{{#if:{{{Workers|}}}|<!--
           --><tr style="border-top: 1px solid white; vertical-align: top;"><!--
           --><tr class="table-tr"><!--
             --><td style="text-align: right; font-weight: bold; padding: 5px 5px 5px 0;">Workers</td><!--
             --><td class="table-td-left">[[Workers]]</td><!--
             --><td style="padding: 5px 0 5px 5px;">{{{Workers}}}</td><!--
             --><td class="table-td-right"><!--
           --></tr>}}<!--
            -->{{#ifeq: {{lc:{{{Workers}}}}} | none | <!--
              -->None|<!--
              -->[[File:Worker.png|link=Workers|16x16px]]&nbsp;{{{Workers}}}<!--
            -->}}<!--
            --></td><!--
           --></tr>|<!--
          -->{{#if: {{NAMESPACE}} || {{#ifeq: {{lc:{{{Designation|}}}}} | transports || [[Category:Machine articles missing workers]] }} }}<!--
        -->}}<!--
         -->{{#if:{{{Electricity|}}}|<!--
         -->{{#if:{{{Electricity|}}}|<!--
           --><tr style="border-top: 1px solid white; vertical-align: top;"><!--
           --><tr class="table-tr"><!--
             --><td style="text-align: right; font-weight: bold; padding: 5px 5px 5px 0;">Electricity</td><!--
            --><td class="table-td-left">[[Electricity]]</td><!--
             --><td style="padding: 5px 0 5px 5px;">{{{Electricity}}} [[File:Electricity.png|14px]]</td><!--
             --><td class="table-td-right"><!--
           --></tr>}}<!--      
            -->{{#ifeq: {{lc:{{{Electricity}}}}} | none | <!--
              -->None | <!--
              -->[[File:Electricity.png|link=Electricity|16x16px]]&nbsp;{{{Electricity}}}<!--
            -->}}<!--
            --></td><!--
          --></tr>|<!--
          -->{{#if: {{NAMESPACE}} || {{#ifeq: {{lc:{{{Designation|}}}}} | transports || [[Category:Machine articles missing electricity]] }} }}<!--
        -->}}<!--
        -->{{#if:{{{Computing|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">[[Computing]]</td><!--
             --><td class="table-td-right"><!--
            -->{{#ifeq: {{lc:{{{Computing}}}}} | none | <!--
              -->None | <!--
              -->[[File:Computing.png|link=Computing|16x16px]]&nbsp;{{{Computing}}} TFlops<!--
            -->}}<!--
            --></td><!--
          --></tr><!--
        -->}}<!--
        -->{{#if:{{{Unity|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">[[Unity]]</td><!--
            --><td class="table-td-right">[[File:Unity.png|link=Unity|16x16px]] {{{Unity}}} /month</td><!--
           --></tr><!--
        -->}}<!--
 
        ** Research speed for Lab
        -->{{#if:{{{ResearchSpeed|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Research Speed</td><!--
            --><td class="table-td-right">{{#expr:trunc({{{ResearchSpeed}}})}}.{{#expr:(({{{ResearchSpeed}}})*10) mod 10}} {{Time}}</td><!--
          --></tr><!--
        -->}}<!--
 
        ** Maintenance **
         -->{{#if:{{{Maintenance|}}}|<!--
         -->{{#if:{{{Maintenance|}}}|<!--
           --><tr style="border-top: 1px solid white; vertical-align: top;"><!--
           --><tr class="table-tr"><!--
             --><td style="text-align: right; font-weight: bold; padding: 5px 5px 5px 0;">Maintenance</td><!--
            --><td class="table-td-left">[[Maintenance]]</td><!--
             --><td style="padding: 5px 0 5px 5px;">{{{Maintenance}}} / 60&nbsp;🕓</td><!--
            --><td class="table-td-right"><!--
           --></tr>}}<!--      
            -->{{#ifeq: {{lc:{{{Maintenance}}}}} | none | <!--
              -->None | <!--
              -->[[File:Maintenance I.png|link=Maintenance I|16x16px]]&nbsp;<!--
              -->{{#expr:trunc({{{Maintenance}}})}}.{{#expr:(({{{Maintenance}}})*10) mod 10}}<!--
                ** Note, this is a hacky way to get around the Mediawiki ParserFunctions's limitation of being unable to format numbers as fixed-length floats **
              -->&nbsp;/&nbsp;60&nbsp;[[File:Clock.png|link=Time|16x16px]]<!--
              -->{{#if: {{NAMESPACE}} || [[Category: Buildings requesting Maintenance I]]}}<!--
            -->}}<!--
            --></td><!--
          --></tr><!--
        -->}}<!--
        -->{{#if:{{{MaintenanceII|}}}|<!--
          --><tr class="table-tr"><!--
             --><td class="table-td-left">[[Maintenance]]</td><!--
            --><td class="table-td-right"><!--
            -->{{#ifeq: {{lc:{{{MaintenanceII}}}}} | none | <!--
              -->None | <!--
              -->[[File:Maintenance II.png|link=Maintenance II|16x16px]]&nbsp;<!--
              -->{{#expr:trunc({{{MaintenanceII}}})}}.{{#expr:(({{{MaintenanceII}}})*10) mod 10}}<!--
                ** Note, this is a hacky way to get around the Mediawiki ParserFunctions's limitation of being unable to format numbers as fixed-length floats **
              -->&nbsp;/&nbsp;60&nbsp;[[File:Clock.png|link=Time|16x16px]]<!--
              -->{{#if: {{NAMESPACE}} || [[Category: Buildings requesting Maintenance II]]}}<!--
            -->}}<!--
            --></td><!--
          --></tr><!--
        -->}}<!--
        -->{{#if:{{{MaintenanceIII|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">[[Maintenance]]</td><!--
             --><td class="table-td-right"><!--
            -->{{#ifeq: {{lc:{{{MaintenanceIII}}}}} | none | <!--
              -->None | <!--
              -->[[File:Maintenance III.png|link=Maintenance III|16x16px]]&nbsp;<!--
              -->{{#expr:trunc({{{MaintenanceIII}}})}}.{{#expr:(({{{MaintenanceIII}}})*10) mod 10}}<!--
                ** Note, this is a hacky way to get around the Mediawiki ParserFunctions's limitation of being unable to format numbers as fixed-length floats **
              -->&nbsp;/&nbsp;60&nbsp;[[File:Clock.png|link=Time|16x16px]]<!--
              -->{{#if: {{NAMESPACE}} || [[Category: Buildings requesting Maintenance III]]}}<!--
            -->}}<!--
            --></td><!--
          --></tr><!--
        -->}}<!--
        -->{{#if: {{{Maintenance}}}{{{MaintenanceII}}}{{{MaintenanceIII}}} || {{#if: {{NAMESPACE}} || {{#ifeq: {{lc:{{{Designation|}}}}} | transports || [[Category:Machine articles missing maintenance]] }} }} }}<!--
 
        ** Footprint **
        -->{{#if:{{{Footprint|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Footprint</td><!--
            --><td class="table-td-right">{{{Footprint}}}</td><!--
          -->{{#if: {{NAMESPACE}} || {{#ifeq: {{{Footprint}}} | ? | [[Category:Machine articles missing footprint]] }} }}<!--
          --></tr>|<!--
          -->{{#if: {{NAMESPACE}} || {{#ifeq: {{lc:{{{Designation|}}}}} | transports || [[Category:Machine articles missing footprint]] }} }}<!--
        -->}}<!--
 
        ** Parameters for storage **
        -->{{#if:{{{Cargo|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Cargo</td><!--
            --><td class="table-td-right">{{{Cargo}}}</td><!--
          --></tr>}}<!--- 
        -->{{#if:{{{Storage|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Storage</td><!--
            --><td class="table-td-right">{{{Storage}}}</td><!--
          --></tr>}}<!--
        -->{{#if:{{{Throughput|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Throughput</td><!--
            --><td class="table-td-right">{{{Throughput}}} / 60&nbsp;[[File:Clock.png|link=Time|16x16px]]</td><!--
           --></tr>}}<!--
 
        ** Required technology **
        -->{{#if:{{{Research|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Required Research</td><!--
            --><td class="table-td-right"><!--
              -->{{#ifeq: {{lc:{{{Research}}}}} | none | None | {{ResearchLink|{{{Research}}}}} }}<!--
              -->{{#if:{{{Research2|}}} | <br/>''or'' {{ResearchLink|{{{Research2}}}}} }}<!--
              -->{{#if:{{{Research3|}}} | <br/>''or'' {{ResearchLink|{{{Research3}}}}} }}<!--
            --></td><!--
          --></tr> | [[Category:Machine articles missing research]] }}<!--
        -->{{#if:{{{BoostByUnity|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Boost by Unity</td><!--
            --><td class="table-td-right"><!--
              -->{{ #ifeq: {{{BoostByUnity}}} | yes <!--
                --> | Available {{#if: {{NAMESPACE}} || [[Category:Boostable Buildings]]}} | <!--
                --> {{ #ifeq: {{{BoostByUnity}}} | no <!--
                  --> | Not Available {{#if: {{NAMESPACE}} || [[Category:Unboostable Buildings]]}} <!--
                  --> | <font color="red">'''ERROR: Input "yes" or "no"'''</font> <!--
                -->}}<!--
              -->}}<!--
            --></td><!--
          --></tr>}}<!--
 
        ** Designation and variants **
        -->{{#if:{{{Designation|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Designation</td><!--
            --><td class="table-td-right"><!--
              -->[[:Category:{{{Designation}}}|{{{Designation}}}]]<!--
              -->{{#if: {{NAMESPACE}} || [[Category:{{{Designation}}}]] }}<!--
              -->{{#if: {{{DesigImgOverride|}}} | <!--
                -->&nbsp;[[File:{{{DesigImgOverride}}}{{!}}16x16px{{!}}link=Category:{{{Designation|}}}]]|<!--
                -->&nbsp;[[File:{{{Designation}}}.png{{!}}16x16px{{!}}link=Category:{{{Designation|}}}]]<!--
                -->}}<!--
          --></tr>|<!--
          -->{{#if: {{NAMESPACE}} || [[Category:Machine articles missing designation]] }}<!--
        -->}}<!--
        -->{{#if:{{{Variants|}}}|<!--
          --><tr class="table-tr"><!--
            --><td class="table-td-left">Variants</td><!--
            --><td class="table-td-right">{{{Variants}}}</td><!--
          --></tr>}}<!--         
       --></table><!--
       --></table><!--
     --></div><!--
     --></div><!--
   --></div><!--
   --></div><!--
    {{#if:{{{Recipes|}}}|<hr style="height:3px; border:0">{{{Recipes}}}}}
--></div><!--
--></div><!--
--></div><!--
--></div><!--
--></includeonly><noinclude>{{documentation}}</noinclude>
--></includeonly><noinclude>{{documentation}}</noinclude>

Latest revision as of 01:23, 31 May 2023

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
Fuel Gas.png
Groundwater Pump
T1
Groundwater Pump.png
In-game building description goes here. The template will handle even very long text gracefully.
Construction
Construction Parts.png
12
+
Iron.png
12
WorkersWorker.png 10
ElectricityElectricity.png 20 KW
UnityUnity.png +1.00 /month
MaintenanceMaintenance I.png 5.0 / 60 Clock.png
Footprint6x4
CargoWater
Storage5000
Required ResearchCement Production
or Basic Desalination
Boost by UnityAvailable
DesignationGeneral Machines Fuel Gas.png
VariantsBlast Furnace II
Example usage:
{{Infobox machine
| Name          = Groundwater Pump
| Tier          = 1
| Image         = 
| Description   = In-game building description goes here. The template will handle even very long text gracefully.
| Recipe        = 
  {{Machine Recipe
    | Input1Name  = Construction Parts
    | Input1Qty   = 12
    | Input2Name  = Iron
    | Input2Qty   = 12
    }}
| Workers       = 10
| Electricity   = 20 KW
| Maintenance   = 5
| Footprint     = 6x4
| Research      = Cement Production <!-- What tech is required for this building to be unlocked -->
| Research2     = Basic Desalination <!-- Accepts at most 3 researches -->
| Cargo         = [[Water]]
| Storage       = 5000
| BoostByUnity  = yes
| Designation   = General Machines
| DesigImgOverride = Fuel Gas.png <!-- only used if needed to override the automatic image -->
| Variants      = [[Blast Furnace II]]
}}

Blank template:

{{Infobox machine
| Name          = 
| Tier          = 
| Image         = 
| Description   = 
| Recipe        = 
  {{Machine Recipe
    | Input1Name  = 
    | Input1Qty   = 
    | Input2Name  = 
    | Input2Qty   = 
    }}
| Workers       = 
| Electricity   = 
| Maintenance   = 
| ResearchSpeed = 
| Footprint     = 
| Research      = 
| Research2     = 
| Research3     = 
| Cargo         = 
| Storage       = 
| BoostByUnity  = 
| Designation   = 
| DesigImgOverride = <!-- only used if needed to override the automatic image -->
| Variants      = 
}}
The above text is transcluded from Template:Infobox machine/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Infobox machine/doc. (View all subpages of this page.)