Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Inventory icon: Difference between revisions

From Vault Hunters Official Wiki
Created page with "local p = {} p.icon = function( f ) local args = f if f == mw.getCurrentFrame() then args = f:getParent().args end local file = args[1] local link = args.link local title = args.title if file:match( '%.gif$' ) or file:match( '%.png$' ) or file:match( '%.webp$' ) then file = 'Invicon ' .. file else file = 'Invicon ' .. file .. '.png' end return '32x32px|link=' .. ( link or '' ) .. '|class=pixel-image|' .. ( title or '' ) .. ''..."
 
(No difference)

Latest revision as of 22:20, 16 June 2025

Usage

Used by {{Inventory icon}}.



local p = {}

p.icon = function( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = f:getParent().args
	end
	
	local file = args[1]
	local link = args.link
	local title = args.title
	
	if file:match( '%.gif$' ) or file:match( '%.png$' ) or file:match( '%.webp$' ) then
		file = 'Invicon ' .. file
	else
		file = 'Invicon ' .. file .. '.png'
	end
	return '[[File:' .. file .. '|32x32px|link=' .. ( link or '' ) .. '|class=pixel-image|' .. ( title or '' ) .. ']]'
end

return p
Contents