31,075
edits
m (Billy Mitchell moved page Module:Sandbox/GameDesc to Module:GameDesc without leaving a redirect) |
No edit summary |
||
Line 6: | Line 6: | ||
function p.main(frame) | function p.main(frame) | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
if not args[3] then | |||
else | else | ||
error("Description of \"" .. thing .. "\" for " .. game .. " not found") | local category = args[1]:lower() --I.e. is it skill or item? | ||
local game = args[2]:lower() | |||
local thing = args[3]:lower() | |||
local dataTable = require("Module:Data/" .. capitalizeFirstLetter(category) .. "/" .. game)[category] | |||
local gameLink = frame:expandTemplate{ title = "Link", args = { "Game", game } } | |||
if dataTable[thing]["effect_note"] then | |||
gameLink = gameLink .. frame:expandTemplate { title = 'exp', args = { dataTable[thing]["effect_note"] } } | |||
elseif dataTable[thing]["name_note"] then | |||
gameLink = gameLink .. frame:expandTemplate { title = 'exp', args = { dataTable[thing]["name_note"] } } | |||
end | |||
local desc = "" | |||
if dataTable[thing]["description_ja"] and dataTable[thing]["description"] then | |||
desc = frame:expandTemplate{ title = "DescTransl", args = { dataTable[thing]["description_ja"], dataTable[thing]["description"] } } | |||
elseif dataTable[thing]["description"] then | |||
desc = dataTable[thing]["description"] | |||
else | |||
error("Description of \"" .. thing .. "\" for " .. game .. " not found") | |||
end | |||
return "\n| style=\"text-align:center\" | " .. gameLink .. "\n| " .. desc .. "\n|-" | |||
end | end | ||
end | end | ||
return p | return p |