Module:Infobox Recipe: Difference between revisions

change behavior for hiding album xp: looks for parameter "hideAlbum" on the page and replaces album xp with "N/A" if it is true
(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:
--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)
 
--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
local argsMaterials = p._extractRawMaterials(args)
Line 204 ⟶ 207:
:done()
:done()
:IFtag(not args.quest'tr')
:tag('trth')
:tag(attr{ colspan = 'th2') }
: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()
:ENDtag('td')
:attr{ colspan = '211' }
: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)')
:tagEND('td')
:done()
:done()
:tag('tr')
:tag('th')
Line 246 ⟶ 247:
:wikitext('Level')
:done()
:IFtag(not args.quest'th')
:tag(attr{ colspan = 'th5') }
:wikitext('[[Knowledge|KP]]')
:attr{ colspan = '5' }
:done()
:wikitext('[[Knowledge|KP]]')
:donetag('th')
:tag(attr{ colspan = 'th5') }
: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()
:tag('tr')
Line 272 ⟶ 266:
:wikitext(hc(args.level) and (args.level) or editButton("'''?''' (edit)").. '[[Category:Needs level recipe]]')
:done()
:IFtag(not args.quest'td')
:tag(attr{ colspan = 'td5') }
:attrcss{ colspan['text-align'] = '5center' }
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)").. '[[Category:Needs knowledge recipe]]')
:css{ ['text-align'] = 'center' }
:ELSEdone()
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)").. '[[Category:Needs knowledge recipe]]')
:donetag('td')
:tag(attr{ colspan = 'td5') }
:attrcss{ colspan['text-align'] = '5center' }
:IF(hideAlbum)
:css{ ['text-align'] = 'center' }
:tagwikitext('thN/A')
:ENDELSE()
:wikitext(album_xp or 'Unknown')
:doneEND()
:ELSEdone()
 
:tag('td')
:attr{ colspan = '10' }
:css{ ['text-align'] = 'center' }
:wikitext(args.quest)
:done()
:END()
:done()
 
19,289

edits