Module:QuestDetails: Difference between revisions
m
Simplify / cleanup (This code should have the exact same effect)
mNo edit summary |
m (Simplify / cleanup (This code should have the exact same effect)) |
||
Line 1:
require('Module:Mw.html extension')
local p = {}
function p.details(frame)
local args = frame:getParent().args
mw.smw.set({
required_for = args.required_for,
next_quest = args.next_quest,
requirements = args.requirements and '\n'..args.requirements,
items = args.items and '\n'..args.items,
recommended = args.recommended and '\n'..args.recommended,
enemies = args.enemies,
override_seq = args.override_seq or 9999
})
local requirements = args.requirements or 'None'
local table = mw.html.create('table')
:addClass('wikitable plainlinks')
:attr{ cellspacing = '3' }
:tag('tr')
:tag('td')
:css{
['vertical-align'] = 'top',
['width'] = '15%',
['padding'] = '1em'
}
:tag('b')
:wikitext('Start Point')
:done()
:done()
:tag(
['max-width'] = '85%',
['width'] = 'auto',
['padding-right'] = '2em'
}
:tag('p')
:wikitext(args.start_point)
:done()
:done()
:IF(args.required_for)
:tag('tr')
:tag('td')
:css{
['vertical-align'] = 'top',
:tag('b')
:wikitext('Required for')
:done()
:done()
:tag(
:css{
['max-width'] = '85%',
['width'] = 'auto',
['padding-left'] = '1em',
['padding-right'] = '2em'
}
:newline()
:wikitext(args.required_for)
:done()
:done()
:done()
:tag('tr')
:css{
['vertical-align'] = 'top',
['width'] = '15%',
['padding'] = '1em'
}
:tag('b')
:wikitext('Requirements')
:done()
:done()
:css{
['max-width'] = '85%',
['width'] = 'auto',
['padding'] = '0.3em'
}
:tag('div')
:newline()
:done()
:done()
:tag('tr')
:css{
['vertical-align'] = 'top',
['width'] = '15%',
['padding'] = '1em'
}
:tag('b')
:wikitext('Items')
:done()
:done()
:css{
['max-width'] = '85%',
['width'] = 'auto',
['padding'] = '0.3em'
}
:wikitext(args.items)
:newline()
:done()
:done()
:done()
:END()
:IF(args.recommended)
:tag('tr')
:tag('td')
:css{
['vertical-align'] = 'top',
['width'] = '15%',
['padding'] = '1em'
}
:tag('b')
:wikitext('Recommended')
:done()
:done()
:tag(
:css{
['max-width'] = '85%',
['width'] = 'auto',
['padding-left'] = '1em'
}
:addClass('lighttable checklist')
:newline()
:wikitext(args.recommended)
:newline()
:done()
:done()
:END()
:IF(args.enemies)
:tag('tr')
:tag('td')
:css{
['vertical-align'] = 'top',
:tag('b')
:wikitext('Enemies')
:done()
:done()
:tag(
['max-width'] = '85%',
['width'] = 'auto',
['padding-left'] = '1em',
}
:tag('div')
:newline()
:wikitext(args.enemies)
:done()
:done()
:END()
:done()
return table
end
|