Module:QuestDetails: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (Simplify / cleanup (This code should have the exact same effect))
(Set smw requirements to "None" if no requirements are given (rather than not setting it))
Line 1: Line 1:
require('strict')
require('Module:Mw.html extension')
require('Module:Mw.html extension')


Line 5: Line 6:
function p.details(frame)
function p.details(frame)
local args = frame:getParent().args
local args = frame:getParent().args
local requirements = (args.requirements and '\n'..args.requirements) or 'None'


mw.smw.set({
mw.smw.set({
Line 10: Line 13:
required_for = args.required_for,
required_for = args.required_for,
next_quest = args.next_quest,
next_quest = args.next_quest,
requirements = args.requirements and '\n'..args.requirements,
requirements = requirements,
items = args.items and '\n'..args.items,
items = args.items and '\n'..args.items,
recommended = args.recommended and '\n'..args.recommended,
recommended = args.recommended and '\n'..args.recommended,
Line 16: Line 19:
override_seq = args.override_seq or 9999
override_seq = args.override_seq or 9999
})
})

local requirements = args.requirements or 'None'


local table = mw.html.create('table')
local table = mw.html.create('table')
Line 90: Line 91:
:tag('div')
:tag('div')
:addClass('lighttable checklist')
:addClass('lighttable checklist')
:newline()
:wikitext(requirements)
:wikitext(requirements)
:newline()
:done()
:done()
:done()
:done()