Wiki

Template:Infobox room: Difference between revisions

From 2D Tower Wiki
This page was last edited on 6 October 2026, at 22:20.
Add explicit separator before garbage description
Gary (talk | contribs)
Match room infobox to Main Page orange theme; wrap long values without changing fields, icons or images
 
(3 intermediate revisions by 2 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: <code>Name</code>, <code>Icon</code>, <code>Image</code>, <code>Description</code>, <code>Construction cost</code>, <code>Maintenance cost</code>, <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>.
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>.


<pre>{{Infobox room
<pre>{{Infobox room
Line 18: Line 18:
</noinclude><includeonly>
</noinclude><includeonly>
<div class="infobox-wrapper">
<div class="infobox-wrapper">
<div class="outer-box">
<div class="outer-box" style="border-color:#e2aa4e;border-radius:8px;background:#f8fbff;color:#10304b;">
<div class="inner-header"><div class="title">{{#if:{{{Icon|}}}|{{Icon|{{{Icon}}}}}&#160;|}}{{{Name|Unknown room}}}</div></div>
<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|}}} | <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: {{{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>}} }}
<div class="inner-table"><table class="table">
<div class="inner-table"><table class="table" style="white-space:normal;table-layout:fixed;overflow-wrap:anywhere;line-height:1.4;">
{{#if:{{{Construction cost|}}}|<tr class="table-tr"><td class="table-td-left">Construction cost</td><td class="table-td-right">{{{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>}}
{{#if:{{{Maintenance cost|}}}|<tr class="table-tr"><td class="table-td-left">Maintenance cost</td><td class="table-td-right">{{{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>}}
{{#if:{{{Rent income|}}}|<tr class="table-tr"><td class="table-td-left">Rent income</td><td class="table-td-right">{{{Rent income}}}</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>}}}}
{{#if:{{{Noise|}}}|<tr class="table-tr"><td class="table-td-left">Noise</td><td class="table-td-right">{{{Noise}}}&#160;{{Icon|stats_noise}}</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>}}
{{#if:{{{Garbage|}}}|<tr class="table-tr"><td class="table-td-left">Garbage</td><td class="table-td-right">{{{Garbage}}}&#160;{{Icon|garbage}}&#160;{{{garbage_description|}}}</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>}}
{{#if:{{{Environment|}}}|<tr class="table-tr"><td class="table-td-left">Environment</td><td class="table-td-right">{{{Environment}}}&#160;{{Icon|flower}}</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>}}
{{#if:{{{Workers|}}}|<tr class="table-tr"><td class="table-td-left">Workers</td><td class="table-td-right">{{{Workers}}}</td></tr>}}
{{#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"><td class="table-td-left">Power</td><td class="table-td-right">{{{Power}}}&#160;{{Icon|power}}</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"><td class="table-td-left">Size</td><td class="table-td-right">{{{Size}}}</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"><td class="table-td-left">Category</td><td class="table-td-right">{{{Category}}}</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>
</table></div>
</div></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
}}