Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Slots/doc: Difference between revisions

Template page
Azera (talk | contribs)
Create documentation for new Slots template
 
Azera (talk | contribs)
Update documentation with logic and logicParams features
 
Line 1: Line 1:
== Usage ==
== Usage ==
Each slot is a semicolon-delimited positional parameter: <code>Name;Type</code>.
Each slot is a Slots/row template
Indices are assigned automatically from 0. To override, add a third value: <code>Name;Type;Index</code>.
<pre>
{{Slots/row|index=0|name=Slot Name|type=SlotType|logicParams=Params}}
</pre>
 
The index and logicParams are optional. If not declared it with auto-increment the index and load the logicParams that match the given slot type.
 
Logic parameters will only render in final table if logic=1 is passed as parameter to Slots template.
 
<pre>
{{Slots|logic=1
...
}}
</pre>


=== Basic example ===
=== Basic example ===
<pre>
<pre>
{{Slots
{{Slots
| Import;None
|{{Slots/row|name=Import|type=None}}
| Export;None
|{{Slots/row|name=Export|type=None}}
| Programmable Chip;ProgrammableChip
|{{Slots/row|name=Programmable Chip|type=ProgrammableChip}}
}}
}}
</pre>
</pre>
{{Slots
{{Slots
| Import;None
|{{Slots/row|name=Import|type=None}}
| Export;None
|{{Slots/row|name=Export|type=None}}
| Programmable Chip;ProgrammableChip
|{{Slots/row|name=Programmable Chip|type=ProgrammableChip}}
}}
}}


Line 20: Line 32:
<pre>
<pre>
{{Slots
{{Slots
| Import;None
|{{Slots/row|name=Import|type=None}}
| Export;None
|{{Slots/row|name=Export|type=None}}
| Special;None;99
|{{Slots/row|index=99|name=Special|type=None}}
}}
}}
</pre>
</pre>
{{Slots
{{Slots
| Import;None
|{{Slots/row|name=Import|type=None}}
| Export;None
|{{Slots/row|name=Export|type=None}}
| Special;None;99
|{{Slots/row|index=99|name=Special|type=None}}
}}
 
=== With automatic logic values in table ===
<pre>
{{Slots|logic=1
|{{Slots/row|name=Battery|type=Battery}}
}}
</pre>
{{Slots|logic=1
|{{Slots/row|name=Battery|type=Battery}}
}}
 
=== With manually declared logic values in table ===
<pre>
{{Slots|logic=1
|{{Slots/row|name=Battery|type=Battery|logicParams=Param1 Param2 Param3}}
}}
</pre>
{{Slots|logic=1
|{{Slots/row|name=Battery|type=Battery|logicParams=Param1 Param2 Param3}}
}}
}}

Latest revision as of 01:28, 13 April 2026

Usage

Each slot is a Slots/row template

{{Slots/row|index=0|name=Slot Name|type=SlotType|logicParams=Params}}

The index and logicParams are optional. If not declared it with auto-increment the index and load the logicParams that match the given slot type.

Logic parameters will only render in final table if logic=1 is passed as parameter to Slots template.

{{Slots|logic=1
...
}}

Basic example

{{Slots
|{{Slots/row|name=Import|type=None}}
|{{Slots/row|name=Export|type=None}}
|{{Slots/row|name=Programmable Chip|type=ProgrammableChip}}
}}
Index Slot Name Type
0 Import None
1 Export None
2 Programmable Chip ProgrammableChip

With manual index override

{{Slots
|{{Slots/row|name=Import|type=None}}
|{{Slots/row|name=Export|type=None}}
|{{Slots/row|index=99|name=Special|type=None}}
}}
Index Slot Name Type
0 Import None
1 Export None
99 Special None

With automatic logic values in table

{{Slots|logic=1
|{{Slots/row|name=Battery|type=Battery}}
}}
Index Slot Name Type Logic Parameters
0 Battery Battery Charge, ChargeRatio, Class, Damage, MaxQuantity, OccupantHash, Occupied, Quantity, ReferenceId

With manually declared logic values in table

{{Slots|logic=1
|{{Slots/row|name=Battery|type=Battery|logicParams=Param1 Param2 Param3}}
}}
Index Slot Name Type Logic Parameters
0 Battery Battery Param1 Param2 Param3