Module:Inventory slot: Difference between revisions
No edit summary |
No edit summary |
||
Line 114: | Line 114: | ||
mod = "Minecraft" | mod = "Minecraft" | ||
end | end | ||
local minecraft = mod ~= "Minecraft" or mod ~= "minecraft" or "" | |||
local img | local img | ||
if | if minecraft then | ||
img = "https://minecraft.wiki/images/Invicon_" .. name .. ".png" | img = "https://minecraft.wiki/images/Invicon_" .. name .. ".png" | ||
elseif mod then | elseif mod then | ||
Line 135: | Line 137: | ||
local link = args.link or '' | local link = args.link or '' | ||
if link == '' then | if link == '' then | ||
if | if minecraft then | ||
link = | link = "https://minecraft.wiki/w/" .. name | ||
else | else | ||
link = i18n.modLink:gsub( '%$1', "Minecraft" ):gsub( '%$2', name ) | link = i18n.modLink:gsub( '%$1', "Minecraft" ):gsub( '%$2', name ) | ||
Line 190: | Line 192: | ||
altText = altText:gsub( '&[0-9a-jl-qs-wr]', '' ) | altText = altText:gsub( '&[0-9a-jl-qs-wr]', '' ) | ||
end | end | ||
item:addClass( 'invslot-item-image' ) | item:addClass( 'invslot-item-image' ) | ||
:wikitext( '[[File:', img, '|32x32px|link=', link or '', '|alt=', altText, '|', escapedTitle, ']]' ) | :wikitext( '[[File:', img, '|32x32px|link=', link or '', '|alt=', altText, '|', escapedTitle, ']]' ) | ||
item:addClass( 'invslot-item-image' ) | |||
:text( mod, " ", name ) | |||
if num and num > 1 and num < 1000 then | if num and num > 1 and num < 1000 then | ||
if link then | if link then |