Template:Item icon: Difference between revisions

From Space Station 14 Wiki
Template:Item icon
(wip)
(replaced logic with a module lookup)
Line 2: Line 2:
-->{{#vardefine: icon_size|{{{size|24px}}}}}<!--
-->{{#vardefine: icon_size|{{{size|24px}}}}}<!--


-->{{#switch: {{lc: {{{1}}}}}
-->{{#vardefine: icon_item_id|{{#invoke: Item|lookup_item_id_by_name|{{{1}}}}}<!--/vardefine-->}}<!--
| lv cable coil
| lv
| lv cable coil 30x
| lv 30x =
{{#vardefine: icon_file|Coillv-30.png}}
{{#vardefine: icon_label|LV cable coil (30)}}


| lv cable coil 10x
-->{{#iferror: {{#var:icon_item_id}}
| lv 10x =
|{{#var:icon_item_id}}
{{#vardefine: icon_file|Coillv-10.png}}
|{{#vardefine: icon_file|{{#invoke: Item|lookup_item_image_by_id|{{#var:icon_item_id}}}}<!--/vardefine-->}}<!--
{{#vardefine: icon_label|LV cable coil (10)}}
   
    -->{{#iferror: {{#var:icon_file}}
        |{{#var:icon_file}}
        |{{#vardefine: icon_label|{{#invoke: Item|lookup_item_name_by_id|{{#var:icon_item_id}}}}<!--/vardefine-->}}<!--


| lv cable coil 20x
--><span class="item-icon"><!--
| lv 20x =
--><span class="item-icon-icon">[[File:{{#var:icon_file}}|{{#var: icon_size}}]]</span><!--
{{#vardefine: icon_file|Coillv-20.png}}
--><span class="item-icon-label">'''{{{label|{{{l|{{#var:icon_label}}}}}<!--/label-->}}}'''</span><!--
{{#vardefine: icon_label|LV cable coil (20)}}
--></span>
 
    }}
| mv cable coil
}}</includeonly><noinclude>
| mv
| mv cable coil 30x
| mv 30x =
{{#vardefine: icon_file|Coilmv-30.png}}
{{#vardefine: icon_label|MV cable coil (30)}}
 
| mv cable coil 10x
| mv 10x =
{{#vardefine: icon_file|Coilmv-10.png}}
{{#vardefine: icon_label|MV cable coil (10)}}
 
| mv cable coil 20x
| mv 20x =
{{#vardefine: icon_file|Coilmv-20.png}}
{{#vardefine: icon_label|MV cable coil (20)}}
 
| hv cable coil
| hv
| hv cable coil 30x
| hv 30x =
{{#vardefine: icon_file|Coilhv-30.png}}
{{#vardefine: icon_label|HV cable coil (30)}}
 
| hv cable coil 10x
| hv 10x =
{{#vardefine: icon_file|Coilhv-10.png}}
{{#vardefine: icon_label|HV cable coil (10)}}
 
| hv cable coil 20x
| hv 20x =
{{#vardefine: icon_file|Coilhv-20.png}}
{{#vardefine: icon_label|HV cable coil (20)}}
}}<!--
 
--><span class="item-icon"><!--
    --><span class="item-icon-icon">[[File:{{#var:icon_file}}|{{#var: icon_size}}]]</span><!--
    --><span class="item-icon-label">'''{{{label|{{{l|{{#var:icon_label}}}}}<!--/label-->}}}'''</span><!--
--></span></includeonly><noinclude>
{{docs}}
{{docs}}


Line 67: Line 26:
"1": {
"1": {
"label": "Item",
"label": "Item",
"description": "What item are you looking for? Select from the list. Any casing is allowed, including lowercase.",
"description": "What item are you looking for? Any casing is allowed, including lowercase.",
"type": "line",
"type": "line",
"suggestedvalues": [
"required": true,
"LV cable coil",
"example": "lv coil"
"LV",
"LV cable coil 10x",
"LV 10x",
"LV cable coil 20x",
"LV 20x",
"LV cable coil 30x",
"LV 30x",
"MV cable coil",
"MV",
"MV cable coil 10x",
"MV 10x",
"MV cable coil 20x",
"MV 20x",
"MV cable coil 30x",
"MV 30x",
"HV cable coil",
"HV",
"HV cable coil 10x",
"HV 10x",
"HV cable coil 20x",
"HV 20x",
"HV cable coil 30x",
"HV 30x"
],
"required": true
},
},
"size": {
"size": {

Revision as of 20:58, 15 August 2024

Template documentation
view or edit this documentation about template documentation

Examples

{{item icon|lv}}

Script error: The function "lookup_item_id_by_name" does not exist.

A list of all items with icons

Contains all items with icons. Updates automatically.

Script error: The function "generate_item_icons_for_all_items_with_icons" does not exist.

Errors

Unknown item

{{item icon|lorem ipsum honk}}

Script error: The function "lookup_item_id_by_name" does not exist.

No image defined for item

{{item icon|foldable}}

Script error: The function "lookup_item_id_by_name" does not exist.

No description.

Template parameters

ParameterDescriptionTypeStatus
Item1

What item are you looking for? Any casing is allowed, including lowercase.

Example
lv coil
Linerequired
Sizesize

Icon size

Default
24px
Linesuggested
Labellabel l

Label override.

Linesuggested