Editing Module:QuestDetails

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 1: Line 1:
local p = {}
local p = {}

local infobox = require('Module:Infobox')
local parse = require('Module:Param Parse')


function p.details(frame)
function p.details(frame)
local args = frame:getParent().args
local _args = frame:getParent().args
local mw = require('mw')
local ret = infobox.new(_args)

ret:defineParams {
if args.start_point then
mw.smw.set({
{ name = 'start_point' },
{ name = 'requirements' },
["start_point"] = tostring(args.start_point),
})
}
end
if args.requirements then
mw.smw.set({
["requirements"] = tostring(args.requirements),
})
end
if args.recommended then
mw.smw.set({
["recommended"] = tostring(args.recommended),
})
end
if args.enemies then
mw.smw.set({
["enemies"] = tostring(args.enemies),
})
end
ret:create()
local requirements;
ret:cleanParams()
if (args.requirements) then

requirements = args.requirements
ret:addClass('questdetails')
else
requirements = 'None'
ret:attr { cellspacing = '3' }

end
local auto_width = { ["max-width"] = "85%", ["width"] = "auto" }
ret:addRow {
local table = mw.html.create( 'table' )
{ tag = 'th', class = "questdetails-header", content = 'Start point' },
table
{ tag = 'argd', class = "questdetails-info", content=infobox.param('name'), css = auto_width }
:attr( 'class', 'wikitable plainlinks' )
}
:attr( 'cellspacing', '3' )

:tag( 'tr' )
:tag( 'td' )
ret:addRow {
{ tag = 'th', class = "questdetails-header", content = 'Requirements' },
:tag( 'b' )
{ tag = 'td', class = "questdetails-info", content=infobox.param('requirements'), colspan = 2 }
:wikitext('Start Point')
:done()
}

:attr('style', 'vertical-align:top; width:15%; padding: 0 1em;')
return ret
: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()
:tag( 'tr' )
:tag( 'td' )
:tag( 'b' )
:wikitext('Requirements')
:done()
:attr('style', 'vertical-align:top; width:15%; padding: 0 1em;')
:done()
:tag( 'td' )
:tag('p')
:wikitext( requirements )
:done()
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;')
:done()
:done()
if (args.recommended) then
table
:tag( 'tr' )
:tag( 'td' )
:tag( 'b' )
:wikitext('Recommended')
:done()
:attr('style', 'vertical-align:top; width:15%; padding: 0 1em;')
:done()
:tag( 'td' )
:tag('p')
:wikitext( args.recommended )
:done()
:attr('style', 'max-width:85%; width:auto; padding-left: 1em; padding-right: 2em;')
: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: 0 1em;')
:done()
:tag( 'td' )
:tag('p')
: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


Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

This page is a member of a hidden category: