Editing Module:Icon
Appearance
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 33: | Line 33: | ||
label='File Prefix', | label='File Prefix', | ||
description='The file prefix to prepend to {labelPrefix}Name.', | description='The file prefix to prepend to {labelPrefix}Name.', | ||
example={'Item', ' | example={'Item', 'Light Cone', 'Character', 'Icon'} | ||
}, | }, | ||
{name='suffix', displayDefault='determined based on {labelPrefix}Name/{labelPrefix}Type', | {name='suffix', displayDefault='determined based on {labelPrefix}Name/{labelPrefix}Type', | ||
| Line 157: | Line 157: | ||
--local characters = mw.loadData('Module:Card/items') | --local characters = mw.loadData('Module:Card/items') | ||
local ALL_DATA = {-- list of {type, data} in the order that untyped items should get checked | local ALL_DATA = {-- list of {type, data} in the order that untyped items should get checked | ||
{'Character', mw.loadData('Module:Card/characters')}, | |||
{'Item', mw.loadData('Module:Card/items')} -- Always leave this one as the last in this list | {'Item', mw.loadData('Module:Card/items')} -- Always leave this one as the last in this list | ||
} | } | ||
| Line 305: | Line 302: | ||
The main entry point for other modules. | The main entry point for other modules. | ||
Creates and returns an Image object with the given arguments. | Creates and returns an Image object with the given arguments. | ||
Infers `args.type` if `args.name` matches a known item/character/ | Infers `args.type` if `args.name` matches a known item/character/Light Cone. | ||
@param {table} args Table containing the arguments: | @param {table} args Table containing the arguments: | ||
@param[opt] {string} args.name The name of the image. | @param[opt] {string} args.name The name of the image. | ||
| Line 355: | Line 352: | ||
-- set defaults and load data based on type | -- set defaults and load data based on type | ||
if image_type == 'Character' then | if image_type == 'Character' or image_type == 'Currency Wars Character' then | ||
image.defaults.suffix = ' | image.prefix = 'Character' | ||
elseif image_type == ' | image.defaults.suffix = 'Icon' | ||
image. | elseif image_type == 'Element' then | ||
elseif image_type == ' | image.prefix = 'Type' | ||
elseif image_type == 'Consumable' then | |||
image.prefix = 'Item' | image.prefix = 'Item' | ||
elseif image_type == 'Relic' then | elseif image_type == 'Relic' then | ||
image.prefix = ' | image.prefix = 'Item' | ||
elseif image_type == ' | elseif image_type == 'Profile Picture' then | ||
image.prefix = ' | image.prefix = 'Profile Picture' | ||
image.link = image.name | |||
image.name = image.name:gsub(' %(Profile Picture%)', '') | |||
elseif image_type == 'Enemy' or image_type == 'Aether Enemy' then | |||
image.prefix = 'Icon Enemy' | |||
image.link = (data and data.link) or image.name | |||
image.defaults.suffix = '' | |||
end | end | ||
return image, image_type, data | return image, image_type, data | ||