Pokémon GO Wiki
Advertisement

此模块的文档可以在Module:Icon/doc创建

--Adapted from: WARFRAME Wiki Icon Module - http://warframe.wikia.com/
--Written by User:ChickenBar
 
local p = {}
 
local IconData = mw.loadData( 'Module:Icon/data' )
 
 
function p.Item(frame)
	local iconname = frame.args[1]
	local textexist = frame.args[2]
	local imagesize = frame.args.imgsize
	local link = ''
	if IconData["Items"][iconname] == nil then          
		return "<span style=\"color:red;\">Invalid</span>"  
	else
		link = IconData["Items"][iconname]["link"]
                iconname = IconData["Items"][iconname]["icon"]
		if (imagesize == nil or imagesize == '') then
			imagesize = 'x26'                                 
		end
		if (textexist == 'text' or textexist == 'Text') then                           
			return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]'
		end
		return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
	end
end

function p.Flag( frame )
        local iconname = frame.args[1]
        local tooltip = frame.args[2]
        local dest = frame.args[3]        
	local textexist = frame.args[4]
        if IconData["Flags"][iconname] == nil then          
              return "<span style=\"color:red;\">Invalid</span>"  
        else
           iconname = IconData["Flags"][iconname]
           if tooltip == nil then
              tooltip = ''
           end
           if dest == nil then
              dest = ''
           end
	   if (textexist == 'text' or textexist == 'Text') then 
	      return '[[File:'..iconname..'|'..tooltip..'|16px|link='..dest..']] [['..dest..'|'..tooltip..']]'
           end
	   return '[[File:'..iconname..'|'..tooltip..'|16px|link='..dest..']]'
        end
end
 
return p
Advertisement