Module:Infobox Recipe: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(quest items will link to the quest instead of displaying xp or kp)
(change behavior for hiding album xp: looks for parameter "hideAlbum" on the page and replaces album xp with "N/A" if it is true)
Line 27: Line 27:
--If set to true, will check if any of the items passed as a rawmaterialparam are actually intermediate materials. Will then change the display order of the infobox.
--If set to true, will check if any of the items passed as a rawmaterialparam are actually intermediate materials. Will then change the display order of the infobox.
local showFullRecipe = yn(args.showFull or 'no', false)
local showFullRecipe = yn(args.showFull or 'no', false)

--If set to true, will check hide the album xp section as the item does not give album xp.
local hideAlbum = yn(args.hideAlbum or 'no', false)
--Get each of the rawmatX parameters from params and store their values in a new table
--Get each of the rawmatX parameters from params and store their values in a new table
local argsMaterials = p._extractRawMaterials(args)
local argsMaterials = p._extractRawMaterials(args)
Line 204: Line 207:
:done()
:done()
:done()
:done()
:IF(not args.quest)
:tag('tr')
:tag('tr')
:tag('th')
:tag('th')
:attr{ colspan = '2' }
:wikitext('[[Experience]]')
:attr{ colspan = '2' }
:wikitext('[[Experience]]')
:done()
:tag('td')
:attr{ colspan = '11' }
:css{ ['text-align'] = 'center' }
:wikitext(hc(args.exp) and (formatNum(tonumber(args.exp))) or editButton("'''?''' (edit)").. '[[Category:Needs experience recipe]]')
:IF(showFullRecipe)
:wikitext(' (')
:wikitext(hc(args.displayXP) and (formatNum(tonumber(args.displayXP))) or ("'''?'''"))
:wikitext(' total)')
:END()
:done()
:done()
:done()
:END()
:tag('td')
:attr{ colspan = '11' }
:css{ ['text-align'] = 'center' }
:wikitext(hc(args.exp) and (formatNum(tonumber(args.exp))) or editButton("'''?''' (edit)").. '[[Category:Needs experience recipe]]')
:IF(showFullRecipe)
:wikitext(' (')
:wikitext(hc(args.displayXP) and (formatNum(tonumber(args.displayXP))) or ("'''?'''"))
:wikitext(' total)')
:END()
:done()
:done()
:tag('tr')
:tag('tr')
:tag('th')
:tag('th')
Line 246: Line 247:
:wikitext('Level')
:wikitext('Level')
:done()
:done()
:IF(not args.quest)
:tag('th')
:tag('th')
:attr{ colspan = '5' }
:wikitext('[[Knowledge|KP]]')
:attr{ colspan = '5' }
:done()
:wikitext('[[Knowledge|KP]]')
:done()
:tag('th')
:tag('th')
:attr{ colspan = '5' }
:wikitext('[[Album|Album XP]]')
:attr{ colspan = '5' }
:done()
:wikitext('[[Album|Album XP]]')
:done()
:ELSE()
:tag('th')
:attr{ colspan = '10' }
:wikitext('Quest Recipe')
:done()
:END()
:done()
:done()
:tag('tr')
:tag('tr')
Line 272: Line 266:
:wikitext(hc(args.level) and (args.level) or editButton("'''?''' (edit)").. '[[Category:Needs level recipe]]')
:wikitext(hc(args.level) and (args.level) or editButton("'''?''' (edit)").. '[[Category:Needs level recipe]]')
:done()
:done()
:IF(not args.quest)
:tag('td')
:tag('td')
:attr{ colspan = '5' }
:attr{ colspan = '5' }
:css{ ['text-align'] = 'center' }
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)").. '[[Category:Needs knowledge recipe]]')
:css{ ['text-align'] = 'center' }
:done()
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)").. '[[Category:Needs knowledge recipe]]')
:done()
:tag('td')
:tag('td')
:attr{ colspan = '5' }
:attr{ colspan = '5' }
:css{ ['text-align'] = 'center' }
:IF(hideAlbum)
:css{ ['text-align'] = 'center' }
:wikitext('N/A')
:ELSE()
:wikitext(album_xp or 'Unknown')
:wikitext(album_xp or 'Unknown')
:done()
:END()
:ELSE()
:done()

:tag('td')
:attr{ colspan = '10' }
:css{ ['text-align'] = 'center' }
:wikitext(args.quest)
:done()
:END()
:done()
:done()