Template:Item: Difference between revisions
(added support for empty labels) |
(added "link" param; improv docs) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly>{{#invoke: Item|generate_item}}</includeonly><noinclude> | ||
}}</includeonly><noinclude> | |||
{{docs|bb= | {{docs|bb= | ||
{{uses lua|Item}} | {{uses lua|Item}} | ||
Line 34: | Line 12: | ||
"1": { | "1": { | ||
"label": "Item", | "label": "Item", | ||
"description": "What item are you looking for? Any casing is allowed, including lowercase.", | "description": "What item are you looking for? ID, name or a custom alias? Use whatever you wish! Any casing is allowed, including lowercase.", | ||
"type": "line", | "type": "line", | ||
"required": true, | "example": "lv coil", | ||
"example": " | "required": true | ||
}, | |||
"2": { | |||
"label": "Amount", | |||
"description": "Amount of item. By default, no amount in particular is chosen.", | |||
"example": "3", | |||
"type": "number", | |||
"suggested": true | |||
}, | }, | ||
"size": { | "size": { | ||
Line 43: | Line 28: | ||
"description": "Icon size", | "description": "Icon size", | ||
"type": "line", | "type": "line", | ||
"default": " | "default": "32px", | ||
"suggested": true | "suggested": true | ||
}, | }, | ||
Line 54: | Line 39: | ||
"l" | "l" | ||
] | ] | ||
}, | |||
"capitalize": { | |||
"aliases": [ | |||
"cap" | |||
], | |||
"label": "Capitalize", | |||
"description": "Makes the first letter in the label uppercase.", | |||
"type": "boolean", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"link": { | |||
"label": "Link", | |||
"description": "A link to give to the item. By default, a link is added if it's defined in the config - read more in Module:Item.", | |||
"type": "wiki-page-name", | |||
"suggested": true | |||
} | } | ||
}, | }, | ||
"paramOrder": [ | "paramOrder": [ | ||
"1", | "1", | ||
"2", | |||
"size", | "size", | ||
"label" | "label", | ||
] | "capitalize", | ||
"link" | |||
], | |||
"description": "Produces an in-game item icon with a label. The label is the name of that item. Items without icons... will not have icons. See extra parameters for extra spice!" | |||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> |
Latest revision as of 05:07, 4 September 2024
Examples
Basic
{{item
↓
LV cable coil
For items without icons
Used here is some abstract item without icon.
{{item
↓
foldable
Specifying amount of items
{{item
↓
25 steel
More examples
Custom label
{{item
↓
hole-maker
Empty label
To remove the label alltogether, pass an empty string to label
.
{{item
↓
Capitalizing the label
This makes the first letter of the label uppercase.
{{item
or
{{item
↓
Proto-kinetic accelerator
or
Proto-kinetic accelerator
Custom icon size
{{item
↓
LV cable coil
Adding links
{{item
↓
A list of all items with icons
See Template:Item/doc/list of items with icons.
A list of all items
See Template:Item/doc/list_of_items.
Errors
Unknown item
{{item
↓
Lua error in Module:Item at line 83: item generation failed: no item was found by ID/name 'lorem ipsum honk'.Produces an in-game item icon with a label. The label is the name of that item. Items without icons... will not have icons. See extra parameters for extra spice!
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item | 1 | What item are you looking for? ID, name or a custom alias? Use whatever you wish! Any casing is allowed, including lowercase.
| Line | required |
Amount | 2 | Amount of item. By default, no amount in particular is chosen.
| Number | suggested |
Size | size | Icon size
| Line | suggested |
Label | label l | Label override. | Line | suggested |
Capitalize | capitalize cap | Makes the first letter in the label uppercase.
| Boolean | suggested |
Link | link | A link to give to the item. By default, a link is added if it's defined in the config - read more in Module:Item. | Page name | suggested |