Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 32: | Line 32: | ||
local guide = mw.title.getCurrentTitle().rootText | local guide = mw.title.getCurrentTitle().rootText | ||
local data = mw.loadJsonData( 'Module:Pokemon/' .. string.sub( shortname[ guide ], 9 ) .. '.json' ) | local data = mw.loadJsonData( 'Module:Pokemon/' .. string.sub( shortname[ guide ], 9 ) .. '.json' ) | ||
local form = | local form = args.form and ' ' .. args.form | ||
local formText = "" | local formText = args.form and " (" .. args.form .. ")" or '' | ||
local root = mw.html.create( 'table' ) | local root = mw.html.create( 'table' ) | ||
:addClass( 'wikitable mid-table' ) | :addClass( 'wikitable mid-table' ) | ||
Line 46: | Line 46: | ||
end | end | ||
for i, v in ipairs( args ) do | for i, v in ipairs( args ) do | ||
local monData = {} | local monData = {} | ||
if data["browser"][v] then | if data["browser"][v] then | ||
Line 62: | Line 57: | ||
else | else | ||
prefix = shortname[guide] | prefix = shortname[guide] | ||
end | end | ||
row:tag( 'td' ):wikitext( "[[File:" .. prefix .. ' ' .. monData.name .. ".png|" .. monData.name .. "]]" .. " " .. '[[' .. guide .. '/Browser#'.. monData.name .. '|' .. monData.name .. ']]' .. formText ) | row:tag( 'td' ):wikitext( "[[File:" .. prefix .. ' ' .. monData.name .. ".png|" .. monData.name .. "]]" .. " " .. '[[' .. guide .. '/Browser#'.. monData.name .. '|' .. monData.name .. ']]' .. formText ) | ||
Line 73: | Line 65: | ||
if monData.loops2page == mw.title.getCurrentTitle().text then | if monData.loops2page == mw.title.getCurrentTitle().text then | ||
loops = monData.loops2 | loops = monData.loops2 | ||
elseif form then | |||
loops = monData[args.form] | |||
else | else | ||
loops = monData.loops | |||
end | end | ||
row:tag( 'td' ):wikitext ( loops ) | row:tag( 'td' ):wikitext ( loops ) |