Module:QuestDetails: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 3: Line 3:
function p.details(frame)
function p.details(frame)
local args = frame.args
local args = frame.args
local mw = require('mw')
if args.start_point then
local params = {}
mw.smw.set({
params['start_point'] = 'value1'
["start_point"] = args.start_point,
params['requirements'] = 'value2'
})
end
mw.smw.set(params)
if args.requirements then
mw.smw.set({
["requirements"] = args.requirements,
})
end
if args.recommended then
mw.smw.set({
["recommended"] = args.recommended,
})
end
if args.enemies then
mw.smw.set({
["enemies"] = args.enemies,
})
end
local requirements;
local requirements;
if (args['requirements']) then
if (args.requirements) then
requirements = args['requirements']
requirements = args.requirements
else
else
requirements = 'None'
requirements = 'None'
Line 51: Line 67:
:done()
:done()
if (args['recommended']) then
if (args.recommended) then
table
table
:tag( 'tr' )
:tag( 'tr' )
Line 62: Line 78:
:tag( 'td' )
:tag( 'td' )
:tag('p')
:tag('p')
:wikitext( args['recommended'] )
:wikitext( args.recommended )
:done()
:done()
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;')
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;')
Line 69: Line 85:
end
end
if (args['enemies']) then
if (args.enemies) then
table
table
:tag( 'tr' )
:tag( 'tr' )
Line 80: Line 96:
:tag( 'td' )
:tag( 'td' )
:tag('p')
:tag('p')
:wikitext( args['enemies'] )
:wikitext( args.enemies )
:done()
:done()
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;')
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;')