Editing Module:QuestDetails
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 3: | Line 3: | ||
function p.details(frame) |
function p.details(frame) |
||
local args = frame:getParent().args |
local args = frame:getParent().args |
||
local mw = require('mw') |
|||
local params = {} |
|||
if args.start_point then |
|||
params['start_point'] = 'value1' |
|||
mw.smw.set({ |
|||
params['requirements'] = 'value2' |
|||
["start_point"] = args.start_point, |
|||
}) |
|||
end |
|||
if args.required_for then |
|||
mw.smw.set({ |
|||
["required_for"] = args.required_for, |
|||
}) |
|||
end |
|||
if args.next_quest then |
|||
mw.smw.set({ |
|||
["next_quest"] = args.next_quest, |
|||
}) |
|||
end |
|||
if args.requirements then |
|||
mw.smw.set({ |
|||
["requirements"] = '\n'..args.requirements, |
|||
}) |
|||
end |
|||
if args.items then |
|||
mw.smw.set({ |
|||
["items"] = '\n'..args.items, |
|||
}) |
|||
end |
|||
if args.recommended then |
|||
mw.smw.set({ |
|||
["recommended"] = '\n'..args.recommended, |
|||
}) |
|||
end |
|||
if args.enemies then |
|||
mw.smw.set({ |
|||
["enemies"] = args.enemies, |
|||
}) |
|||
end |
|||
mw.smw.set(params) |
|||
local requirements; |
|||
if (args.requirements) then |
|||
requirements = args.requirements |
|||
else |
|||
requirements = 'None' |
|||
end |
|||
local |
local div = mw.html.create( 'div' ) |
||
div:wikitext( "Testing" ) |
|||
table |
|||
if (args[1]) then |
|||
:attr( 'class', 'wikitable plainlinks' ) |
|||
div:wikitext( args[1].tostring() ) |
|||
:attr( 'cellspacing', '3' ) |
|||
end |
|||
:tag( 'tr' ) |
|||
if (args[2]) then |
|||
:tag( 'td' ) |
|||
div:wikitext( args[2].tostring() ) |
|||
:tag( 'b' ) |
|||
end |
|||
:wikitext('Start Point') |
|||
:done() |
|||
return div |
|||
:attr('style', 'vertical-align:top; width:15%; padding: 1em;') |
|||
:done() |
|||
:tag( 'td' ) |
|||
:tag('p') |
|||
:wikitext( args['start_point'] ) |
|||
:done() |
|||
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;') |
|||
:done() |
|||
:done() |
|||
if (args.required_for) then |
|||
table |
|||
:tag( 'tr' ) |
|||
:tag( 'td' ) |
|||
:tag( 'b' ) |
|||
:wikitext('Required for') |
|||
:done() |
|||
:attr('style', 'vertical-align:top; width:15%; padding: 1em;') |
|||
:done() |
|||
:tag( 'td' ) |
|||
:tag('div') |
|||
:newline() |
|||
:wikitext( args.required_for ) |
|||
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;') |
|||
:done() |
|||
:done() |
|||
end |
|||
table |
|||
:tag( 'tr' ) |
|||
:tag( 'td' ) |
|||
:attr('style', 'vertical-align:top; width:15%; padding: 1em;') |
|||
:tag( 'b' ) |
|||
:wikitext('Requirements') |
|||
:done() |
|||
:done() |
|||
:tag( 'td' ) |
|||
:attr('style', 'max-width:85%; width:auto; padding: 0.3em;') |
|||
:tag('div') |
|||
:addClass('lighttable checklist') |
|||
:newline() |
|||
:wikitext(requirements) |
|||
:newline() |
|||
:done() |
|||
:done() |
|||
:done() |
|||
if (args.items) then |
|||
table |
|||
:tag( 'tr' ) |
|||
:tag( 'td' ) |
|||
:attr('style', 'vertical-align:top; width:15%; padding: 1em;') |
|||
:tag( 'b' ) |
|||
:wikitext('Items') |
|||
:done() |
|||
:done() |
|||
:tag( 'td' ) |
|||
:attr('style', 'max-width:85%; width:auto; padding: 0.3em;') |
|||
:tag('div') |
|||
:addClass('lighttable checklist') |
|||
:newline() |
|||
:wikitext(args.items) |
|||
:newline() |
|||
:done() |
|||
:done() |
|||
:done() |
|||
end |
|||
if (args.recommended) then |
|||
table |
|||
:tag( 'tr' ) |
|||
:tag( 'td' ) |
|||
:tag( 'b' ) |
|||
:wikitext('Recommended') |
|||
:done() |
|||
:attr('style', 'vertical-align:top; width:15%; padding: 1em;') |
|||
:done() |
|||
:tag( 'td' ) |
|||
:attr('style', 'max-width:85%; width:auto; padding-left: 1em;') |
|||
:tag('div') |
|||
:addClass('lighttable checklist') |
|||
:newline() |
|||
:wikitext( args.recommended ) |
|||
:newline() |
|||
:done() |
|||
:done() |
|||
end |
|||
if (args.enemies) then |
|||
table |
|||
:tag( 'tr' ) |
|||
:tag( 'td' ) |
|||
:tag( 'b' ) |
|||
:wikitext('Enemies') |
|||
:done() |
|||
:attr('style', 'vertical-align:top; width:15%; padding: 1em;') |
|||
:done() |
|||
:tag( 'td' ) |
|||
:tag('div') |
|||
:newline() |
|||
:wikitext( args.enemies ) |
|||
:done() |
|||
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;') |
|||
:done() |
|||
:done() |
|||
end |
|||
table:done() |
|||
return tostring( table ) |
|||
end |
end |
||