Module:Matchup: Difference between revisions

From Wavu Wiki, the 🌊 wavy Tekken wiki
(Created page with "local p = {}; p.main = function(frame) local p1 = frame[1] local p2 = frame[2] return p._main(p1, p2) end p._main = function(p1, p2) if p1 == p2 then return '' end loca...")
 
No edit summary
Line 2: Line 2:


p.main = function(frame)
p.main = function(frame)
local p1 = frame[1]
local p1 = frame.args[1]
local p2 = frame[2]
local p2 = frame.args[2]
return p._main(p1, p2)
return p._main(p1, p2)
end
end

Revision as of 07:30, 19 January 2021

Documentation for this module may be created at Module:Matchup/doc

local p = {};

p.main = function(frame)
	local p1 = frame.args[1]
	local p2 = frame.args[2]
	return p._main(p1, p2)
end

p._main = function(p1, p2)
	if p1 == p2 then return '' end
	local label = p2
	local class = p2:lower():gsub("%s+","-")
	if p1 > p2 then
		p2, p1 = p1, p2
	end
	local pageTitle = p1 .. " vs " .. p2
	return mw.getCurrentFrame():expandTemplate{
		title = "CharSelectChar",
		args = { label, class, pageTitle }
	}
end

return p