Module:Sandbox/JaydenKieran: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (1 revision imported) |
(No difference)
|
Latest revision as of 21:23, 4 November 2021
Documentation for this module may be created at Module:Sandbox/JaydenKieran/doc
-- <pre>
-- {{Quest details}}
--
local p = {}
local yesno = require( 'Module:Yesno' )
function p.details( frame )
local _args = frame:getParent().args
local qdDiv = mw.html.create( 'div' )
:addClass( 'questdetails-new plainlinks' )
local title = mw.uri.fullUrl( mw.title.getCurrentTitle().fullText, { action = 'edit' } )
local unknown = 'Unknown <small>[' .. tostring( title ) .. ' edit]</small>'
local args = {}
for k, v in pairs(_args) do
if v ~= '' then
args[k] = v
end
end
local icon = args.icon and '[[File:' .. args.icon .. '|50px]]' or ''
local start = args.start or unknown
local members = yesno( args.members ) and '[[File:P2P icon.png|30px|link=]] Members only' or
-- check it's actually set to something false-y
yesno( args.members ) == false and '[[File:F2P icon.png|30px|link=]] Free to play' or unknown
local difficulties = {
none = 'None',
tutorial = '[[File:Novice.svg|7px|Tutorial|link=]] Tutorial',
novice = '[[File:Novice.svg|7px|Novice|link=]] Novice',
intermediate = '[[File:Intermediate.svg|7px|Intermediate|link=]] Intermediate',
experienced = '[[File:Experienced.svg|7px|Experienced|link=]] Experienced',
master = '[[File:Master.svg|7px|Master|link=]] Master',
grandmaster = '[[File:Grandmaster.svg|7px|Grandmaster|link=]] Grandmaster',
special = '[[File:Special.svg|7px|Special|link=]] Special'
}
local difficulty = difficulties[mw.ustring.lower(args.difficulty or '')] or unknown
local length = args.length or unknown
local reqs = args.requirements or '* None'
local items = args.items or '* None'
local kills = args.kills or '* None'
qdDiv
:tag( 'div' )
:addClass( 'questdetails-start' )
-- :tag( 'div' )
-- :addClass( 'questdetails-icon' )
-- :wikitext( icon )
-- :done()
:wikitext( '[[File:Quest map icon.png|17px|link=]] ' .. start )
:done()
:tag( 'div' )
:addClass( 'questdetails-top' )
:tag( 'div' )
:addClass( 'questdetails-members' )
:wikitext( members)
:done()
:tag( 'div' )
:addClass( 'questdetails-difficulty' )
:wikitext( difficulty )
:done()
:tag( 'div' )
:addClass( 'questdetails-length' )
:wikitext( length )
:done()
:done()
:tag( 'div' )
:addClass( 'questdetails-container' )
:tag( 'div' )
:addClass( 'questdetails-reqs' )
:tag( 'div' )
:addClass( 'questdetails-header' )
:wikitext( 'Requirements' )
:done()
:tag( 'div' )
:addClass( 'questdetails-info' )
:tag( 'i' )
:wikitext( 'Skill requirements are not boostable unless marked with a [B] for boostable.' )
:done()
:newline():newline()
:wikitext( reqs )
:done()
:done()
:tag( 'div' )
:addClass( 'questdetails-items' )
:tag( 'div' )
:addClass( 'questdetails-header' )
:wikitext( 'Items required' )
:done()
:tag( 'div' )
:addClass( 'questdetails-info' )
:tag( 'i' )
:wikitext( 'Items from the [[tool belt]] are not listed unless they do not work or are not automatically added.' )
:done()
:newline():newline()
:wikitext( items )
:done()
:done()
:done()
if args.recommended ~= nil and yesno( args.recommended ) ~= false then
qdDiv
:tag( 'div' )
:addClass( 'questdetails-container' )
:tag( 'div' )
:addClass( 'questdetails-recommended' )
:tag( 'div' )
:addClass( 'questdetails-header' )
:wikitext( 'Recommended' )
:done()
:tag( 'div' )
:addClass( 'questdetails-info' )
:newline():newline()
:wikitext( args.recommended )
:done()
:done()
:done()
end
qdDiv
:tag( 'div' )
:addClass( 'questdetails-container' )
:tag( 'div' )
:addClass( 'questdetails-enemies' )
:tag( 'div' )
:addClass( 'questdetails-header' )
:wikitext( 'Enemies to defeat' )
:done()
:tag( 'div' )
:addClass( 'questdetails-info' )
:newline():newline()
:wikitext( kills )
:done()
:done()
:done()
return tostring( qdDiv )
end
return p