Leaguepedia | League of Legends Esports Wiki
[checked revision][checked revision]
No edit summary
No edit summary
Line 1: Line 1:
 
local p = {}
 
local p = {}
   
function p.champion ( frame )
+
function p.Champion ( frame )
 
local args = frame
 
local args = frame
 
if frame == mw.getCurrentFrame() then
 
if frame == mw.getCurrentFrame() then

Revision as of 08:43, 26 May 2018

Edit the documentation or categories for this module.

If you are an editor wanting to update the list of champions, see {{Championnames}}m


local p = {}

function p.Champion ( frame )
	local args = frame
	if frame == mw.getCurrentFrame() then
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		frame = mw.getCurrentFrame()
	end
	
	local Styles = require('Module:Championstyles')
	local Names = mw.loadData( 'Module:Championnames' )
	
	local input = args[1] or 'Unknown'
	local inputlc = string.lower(input)
	local style = string.lower(args[2] or 'default')
	
	local link = Names[inputlc] or input
	local display = args.display or link
	
	if args.size then
		if string.sub(args.size,-2) == "px" then
			args.size = string.sub(args.size,1,-3)
		end
	end
	
	local text = Styles[style](link, display, args['size'])
	
	return text
end

return p