本站文本内容除另有声明外,转载时均必须注明出处,并遵守CC BY-NC-SA 3.0协议。(转载须知
本站是中文Minecraft Wiki的镜像站,与Mojang Studios、Weird Gloop没有从属关系。(免责声明

全站通知:

模块:Inventory icon

来自我的世界地下城WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索
[创建 | 历史 | 清除缓存]文档页面
此模板没有文档页面。如果你知道此模板的使用方法,请帮助为其创建文档页面。
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