本站文本内容除另有声明外,转载时均必须注明出处,并遵守CC BY-NC-SA 3.0协议。(转载须知)
本站是中文Minecraft Wiki的镜像站,与Mojang Studios、Weird Gloop没有从属关系。(免责声明)
全站通知:
模块:Inventory icon
刷
历
编
跳到导航
跳到搜索
local sprite = require( [[Module:Sprite]] ).sprite
local ids = mw.loadData( [[Module:InvSprite]] ).ids
local p = {}
p.icon = function( f )
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
local idData = ids[args[1]]
local icon, category
local link = args.link
local title = args.title
if idData then
icon, category = sprite{
iddata = idData, link = link, title = title,
data = 'InvSprite'
}
else
local file = args[1]
if file:match( '\.gif$' ) or file:match( '\.png$' ) then
file = 'Invicon ' .. file
else
file = 'Grid ' .. file .. '.png'
end
icon = '[[File:' .. file .. '|32x32px|link=' .. ( link or '' ) .. '|' .. ( title or '' ) .. ']]'
end
return icon .. ( category or '' )
end
return p