Module:MissionDetails: Difference between revisions
No edit summary |
mNo edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 16: | Line 16: | ||
impossible = 'Impossible', | impossible = 'Impossible', | ||
} | } | ||
function p.details( frame ) | function p.details( frame ) | ||
local _args = frame:getParent().args | local _args = frame:getParent().args | ||
| Line 35: | Line 34: | ||
local icon = args.icon and '[[File:' .. args.icon .. '|50px|right]]' or '' | local icon = args.icon and '[[File:' .. args.icon .. '|50px|right]]' or '' | ||
local start = args.start or unknown | local start = args.start or unknown | ||
local difficulty = difficulties[mw.ustring.lower(args.difficulty or '')] or unknown | local difficulty = difficulties[mw.ustring.lower(args.difficulty or '')] or unknown | ||
local length = args.length or unknown | local length = args.length or unknown | ||
| Line 56: | Line 52: | ||
:tag( 'td' ) | :tag( 'td' ) | ||
:addClass( 'missiondetails-info' ) | :addClass( 'missiondetails-info' ) | ||
:wikitext( ' | :wikitext( '' .. icon .. start ) | ||
:done() | :done() | ||
:done() | :done() | ||
| Line 98: | Line 84: | ||
:addClass( 'qc-active' ) | :addClass( 'qc-active' ) | ||
:tag( 'i' ) | :tag( 'i' ) | ||
:wikitext( ' | :wikitext( '' ) | ||
:done() | :done() | ||
:newline():newline() | :newline():newline() | ||
| Line 112: | Line 98: | ||
:addClass( 'missiondetails-info' ) | :addClass( 'missiondetails-info' ) | ||
:tag( 'i' ) | :tag( 'i' ) | ||
:wikitext( ' | :wikitext( '' ) | ||
:done() | :done() | ||
:newline():newline() | :newline():newline() | ||
| Line 168: | Line 154: | ||
items = args.items or 'None', | items = args.items or 'None', | ||
kills = args.kills or 'None', | kills = args.kills or 'None', | ||
} | } | ||
local jsongood, encsmwJSON = pcall(mw.text.jsonEncode, smwJSON) | local jsongood, encsmwJSON = pcall(mw.text.jsonEncode, smwJSON) | ||
| Line 191: | Line 176: | ||
local smw = { | local smw = { | ||
['Official difficulty'] = args.difficulty or nil, | ['Official difficulty'] = args.difficulty or nil, | ||
['Official length'] = args.length or nil, | ['Official length'] = args.length or nil, | ||
} | } | ||
return tostring(info) .. tostring(err) | return tostring(info) .. tostring(err) | ||