Module:Icon/doc

From Final Fantasy XIV Online Wiki
Jump to navigation Jump to search

This is the documentation page for Module:Icon

This module contains several functions for rendering icons from the game, for use with both wikitext templates as well as from other Lua modules.


Wikitext functions

These functions are designed to be used directly in templates via {{#invoke:}}.

renderGameIcon

Renders the in-game icon of something.

Parameters

type
The type of thing being shown - quest, item, currency, action, achievement, etc. Usually pulled from Property:Has context.
icon
Icon file reference, including File: namespace and file extension. Usually pulled from Property:Has game icon.
link
Where the icon should link when clicked, usually the article name of the relevant concept.
size
Icon size. One of small, mid, or large. Defaults to small.

For item icons specifically, these parameters can also be used:

hq
If set, renders a high-quality item.
dyeCount
If set, renders an item with a number of dye slots. Usually pulled from Property:Has dye channels.

Example

{{#invoke: Icon | renderGameIcon
| type = Action
| icon = File:Transpose.png
| link = Transpose
| size = big
}}

renderGameIconWithLabel

Renders an in-game icon, alongside a label which links back to the thing, plus an optional quantity.

Parameters

All parameters taken by renderGameIcon, plus:

text
Label text. This text will be a link that directs to the link parameter. Pass nothing or set to "x" to hide the label (useful to display quantity in a condensed way).
qty
Quantity, displayed between the item icon and the label.
allowWrap
By default, icon and label will be grouped in a container that prevents text wrapping. Set this parameter to disable that behavior. This should only really be used in infoboxes and other narrow templates.

Examples

{{#invoke: Icon | renderGameIconWithLabel
| type = Action
| icon = File:Cure.png
| link = Cure
| size = small
| text = Freecure isn't real and can't hurt you
}}

Freecure isn't real and can't hurt you

Lua functions

These functions are designed to be called from other Lua modules and accept Lua values as their parameters instead of mw.frame objects. To use any of these functions, load the module first with e.g.

local icon = require("Module:Icon")

plainIcon

Displays a non-framed icon from the game, for example quest icons.

Parameters

Takes a single table parameter with the following keys:

icon
Icon file reference, including File: namespace and file extension.
link
Where the icon should link when clicked, usually the article name of the relevant concept.
size
Icon size. One of small, mid, or large. Defaults to small.

Returns

  • A wikitext string.

Example

local questIcon = icon.plainIcon({
    icon = "File:Quest icon.png",
    link = "Quest",
    size = "big",
})

frameIcon

Displays a framed icon from the game, for example an item or action.

Parameters

Takes a single table parameter with the following keys:

icon
Icon file reference, including File: namespace and file extension.
link
Where the icon should link when clicked, usually the article name of the relevant concept.
frame
Frame type for the icon. Can be hq, trait, achievement, or leave nil for the standard frame.
dyeCount
For items, the number of dye slots the item has. Default is 0.
size
Icon size. One of small, mid, or large. Defaults to small.

Returns

Example

local traitIcon = icon.frameIcon({
    icon = "File:Heavier shot.png",
    link = "Heavier Shot",
    frame = "trait",
    size = "big",
})