Difference between revisions of "Template:Section"

From RimWorld Wiki
Jump to navigation Jump to search
(templatize some redundant sections like heat, light, and fuel)
 
m
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
{{#Switch: {{{1}}}
+
{{#Switch: {{{1|}}}
 
| Light = light section
 
| Light = light section
 
| Heat = heat section
 
| Heat = heat section
Line 6: Line 6:
 
| Mineable = mineable section
 
| Mineable = mineable section
 
| Default
 
| Default
}}
+
}}</includeonly>
</includeonly>
 
 
<noinclude>{{Documentation}}</noinclude>
 
<noinclude>{{Documentation}}</noinclude>

Revision as of 04:27, 23 August 2024

Documentation icon Template documentation[view] [edit] [history] [purge]

Overview

Used for objects to automate the content of sections like heat, light, and fuel.

{{#if: {{{glowradius|}}} |
  {{#if: {{#var:setProperty}} | {{#set:Glow Radius = {{{glowradius|}}} }} }}
}}
{{#if: {{{glowcolor|}}} |
  {{#if: {{#var:setProperty}} | {{#set:Glow Color = {{{glowcolor|}}} }} }}
  {{#vardefine:Red  | {{#replace:{{#explode:{{{glowcolor|}}}|,|0}}|(}} }}
  {{#vardefine:Green| {{#explode:{{{glowcolor|}}}|,|1}} }}
  {{#vardefine:Blue | {{#replace:{{#explode:{{{glowcolor|}}}|,|2}}|)}} }}
  {{#vardefine:LightRadius|{{Lit Radius|{{{glowradius|}}}|{{#expr:{{#var:Red}}+{{#var:Green}}+{{#var:Blue}} }} }} }}
  {{#if: {{#var:setProperty}} | {{#set:Light Radius = {{#var:LightRadius}} }} }}
;<abbr title="The furthest away a tile can be before it falls below 30% light">Light Radius</abbr>
:{{#expr:{{#var:LightRadius}} round 2}} <!--
Color Square: --><abbr title="RGB: {{{glowcolor|}}}"><span><div style="width:16px;height:16px;background-color:rgb({{#var:Red}},{{#var:Green}},{{#var:Blue}});display:inline-block;border:1px solid black;vertical-align:middle;"></div></span></abbr>
}}

Usage

{{Section|Light}}

light section

{{Section|Heat}}

heat section

{{Section|Fuelable}}

fuelable section

{{Section|Mineable}}

mineable section