Wiki

Template:Infobox room: Difference between revisions

From 2D Tower Wiki
This page was last edited on 6 October 2026, at 22:20.
Create room building infobox template
 
Gary (talk | contribs)
Match room infobox to Main Page orange theme; wrap long values without changing fields, icons or images
 
(12 intermediate revisions by 3 users not shown)
Line 2: Line 2:
This template provides a standard infobox for a room building.
This template provides a standard infobox for a room building.


Parameters:
Parameters: <code>Name</code>, <code>Icon</code>, <code>Image</code>, <code>Description</code>, <code>Construction cost</code>, <code>Maintenance cost</code>, <code>Recurring charges</code> (or legacy <code>Rent income</code>), <code>Noise</code>, <code>Garbage</code>, <code>garbage_description</code>, <code>Environment</code>, <code>Workers</code>, <code>Power</code>, <code>Size</code>, and <code>Category</code>.
* <code>Name</code> - room building name.
* <code>Image</code> - optional image filename, such as <code>Hotel.png</code>.
* <code>Description</code> - room building description.
* <code>Construction cost</code> - cost to build the room.
* <code>Maintenance cost</code> - ongoing maintenance cost.
* <code>Workers</code> - workers required.
* <code>Power</code> - power consumption or production.
* <code>Size</code> - footprint or dimensions.
* <code>Category</code> - room building category.


Usage:
<pre>{{Infobox room
<pre>{{Infobox room
|Name=Hotel
|Name=Hotel
|Image=Hotel.png
|Image=Hotel.png
|Icon=hotel
|Description=Provides accommodation for tenants.
|Description=Provides accommodation for tenants.
|Construction cost=1000
|Construction cost=1000
Line 25: Line 16:
|Category=Residential
|Category=Residential
}}</pre>
}}</pre>
</noinclude>
</noinclude><includeonly>
<includeonly>
<div class="infobox-wrapper">
<table class="infobox room-infobox" style="float:right; clear:right; width:300px; margin:0 0 1rem 1.5rem; border:1px solid #c8ccd1; border-collapse:collapse; background:#f8f9fa;">
<div class="outer-box" style="border-color:#e2aa4e;border-radius:8px;background:#f8fbff;color:#10304b;">
<tr><th colspan="2" style="padding:0.75rem; background:#eaecf0; font-size:1.2em;">{{{Name|}}}</th></tr>
<div class="inner-header" style="background:#ffb12b;color:#14364b;border-bottom-color:#e2aa4e;"><div class="title">{{#if:{{{Icon|}}}|{{Icon|{{{Icon}}}}}&#160;|}}{{{Name|Unknown room}}}</div></div>
{{#if:{{{Image|}}}|<tr><td colspan="2" style="padding:0.75rem; text-align:center;">[[File:{{{Image}}}|frameless|250px|alt={{{Name|}}}]]</td></tr>}}
{{#if: {{{Image|}}} | <div class="inner-main"><div>[[File:{{{Image}}}{{!}}250x250px{{!}}alt={{{Name|}}}]]</div>{{#if: {{{Description|}}} | <div class="description">{{{Description}}}</div>}}</div> | {{#if: {{{Description|}}} | <div class="inner-main"><div class="description">{{{Description}}}</div></div>}} }}
{{#if:{{{Description|}}}|<tr><td colspan="2" style="padding:0.75rem;">{{{Description}}}</td></tr>}}
<div class="inner-table"><table class="table" style="white-space:normal;table-layout:fixed;overflow-wrap:anywhere;line-height:1.4;">
<tr><th style="padding:0.5rem; text-align:left; border-top:1px solid #c8ccd1;">Construction cost</th><td style="padding:0.5rem; border-top:1px solid #c8ccd1;">{{{Construction cost|—}}}</td></tr>
{{#if:{{{Construction cost|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">Construction cost</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Construction cost}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Maintenance cost</th><td style="padding:0.5rem;">{{{Maintenance cost|—}}}</td></tr>
{{#if:{{{Maintenance cost|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">Maintenance cost</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Maintenance cost}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Workers</th><td style="padding:0.5rem;">{{{Workers|—}}}</td></tr>
{{#if:{{{Recurring charges|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{#switch:{{{Name|}}}|Condo=Condo Fees|#default=Rent}}</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Recurring charges}}}</td></tr>|{{#if:{{{Rent income|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{#switch:{{{Name|}}}|Condo=Condo Fees|#default=Rent}}</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Rent income}}}</td></tr>}}}}
<tr><th style="padding:0.5rem; text-align:left;">Power</th><td style="padding:0.5rem;">{{{Power|—}}}</td></tr>
{{#if:{{{Noise|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">[[Noise|Noise]]</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Noise}}}&#160;{{Icon|stats_noise}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Size</th><td style="padding:0.5rem;">{{{Size|—}}}</td></tr>
{{#if:{{{Garbage|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">[[Garbage|Garbage]]</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Garbage}}}&#160;{{Icon|garbage}}&#160;{{{garbage_description|}}}</td></tr>}}
<tr><th style="padding:0.5rem; text-align:left;">Category</th><td style="padding:0.5rem;">{{{Category|—}}}</td></tr>
{{#if:{{{Environment|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">[[Environment|Environment]]</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Environment}}}&#160;{{Icon|flower}}</td></tr>}}
</table>
{{#if:{{{Workers|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">Workers</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Workers}}}</td></tr>}}
{{#if:{{{Power|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">[[Power|Power]]</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Power}}}&#160;{{Icon|power}}</td></tr>}}
{{#if:{{{Size|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">Size</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Size}}}</td></tr>}}
{{#if:{{{Category|}}}|<tr class="table-tr" style="border-top-color:#e2aa4e;"><td class="table-td-left" style="width:40%;background:#f8fbff;color:#10304b;border-color:#e2aa4e;">Category</td><td class="table-td-right" style="background:#f8fbff;color:#10304b;border-color:#e2aa4e;">{{{Category}}}</td></tr>}}
</table></div>
</div></div>
</includeonly>
</includeonly>

Latest revision as of 22:20, 6 October 2026

This template provides a standard infobox for a room building.

Parameters: Name, Icon, Image, Description, Construction cost, Maintenance cost, Recurring charges (or legacy Rent income), Noise, Garbage, garbage_description, Environment, Workers, Power, Size, and Category.

{{Infobox room
|Name=Hotel
|Image=Hotel.png
|Icon=hotel
|Description=Provides accommodation for tenants.
|Construction cost=1000
|Maintenance cost=25
|Workers=2
|Power=10
|Size=4x4
|Category=Residential
}}