Anonymous

Module:Navboxes: Difference between revisions

From Melvor Idle
m
no edit summary
mNo edit summary
mNo edit summary
Line 31: Line 31:
     elseif i == 2 or i == 3 or i == 5 or i == 7 or i == 8 then
     elseif i == 2 or i == 3 or i == 5 or i == 7 or i == 8 then
       table.insert(treeProduceTable, Icons.Icon({item.name, type='item'}))   
       table.insert(treeProduceTable, Icons.Icon({item.name, type='item'}))   
    end
  end
  local allotmentSeeds = table.concat(allotmentSeedsTable, ' • ')
  local allotmentProduce = table.concat(allotmentProduceTable, ' • ')
  local herbSeeds = table.concat(herbSeedsTable, ' • ')
  local herbProduce = table.concat(herbProduceTable, ' • ')
  local treeSeeds = table.concat(treeSeedsTable, ' • ')
  local treeProduce = table.concat(treeProduceTable, ' • ')
  local pagename = ''
  local allotment = 'mw-collapsed'
  local herb = 'mw-collapsed'
  local tree = 'mw-collapsed'
  if frame.args ~= nil and frame.args[1] then
    pagename = frame.args[1]
    if Shared.contains(allotmentSeeds, pagename) or Shared.contains(allotmentProduce, pagename) then
      allotment = ''
    elseif Shared.contains(herbSeeds, pagename) or Shared.contains(herbProduce, pagename) then
      herb = ''
    elseif Shared.contains(treeSeeds, pagename) or Shared.contains(treeProduce, pagename) then
      tree = ''
     end
     end
   end
   end
Line 61: Line 39:
   result = result..'\r\n!colspan="2"|Allotments'
   result = result..'\r\n!colspan="2"|Allotments'
   result = result..'\r\n|-\r\n!scope="row"|Seeds'
   result = result..'\r\n|-\r\n!scope="row"|Seeds'
   result = result..'\r\n|style="text-align:center;|'..allotmentSeeds
   result = result..'\r\n|style="text-align:center;|'..table.concat(allotmentSeedsTable, ' • ')
   result = result..'\r\n|-\r\n!scope="row"|Produce'
   result = result..'\r\n|-\r\n!scope="row"|Produce'
   result = result..'\r\n|style="text-align:center;|'..allotmentProduce
   result = result..'\r\n|style="text-align:center;|'..table.concat(allotmentProduceTable, ' • ')
   result = result..'\r\n|}'
   result = result..'\r\n|}'
   result = result..'\r\n|-\r\n{| class="wikitable mw-collapsible '..herb..'" style="margin:auto; clear:both; width: 100%"'
   result = result..'\r\n|-\r\n{| class="wikitable mw-collapsible '..herb..'" style="margin:auto; clear:both; width: 100%"'
   result = result..'\r\n!colspan="2"|Herbs'
   result = result..'\r\n!colspan="2"|Herbs'
   result = result..'\r\n|-\r\n!scope="row"|Seeds'
   result = result..'\r\n|-\r\n!scope="row"|Seeds'
   result = result..'\r\n|style="text-align:center;|'..herbSeeds
   result = result..'\r\n|style="text-align:center;|'..table.concat(herbSeedsTable, ' • ')
   result = result..'\r\n|-\r\n!scope="row"|Produce'
   result = result..'\r\n|-\r\n!scope="row"|Produce'
   result = result..'\r\n|style="text-align:center;|'..herbProduce
   result = result..'\r\n|style="text-align:center;|'..table.concat(herbProduceTable, ' • ')
   result = result..'\r\n|}'
   result = result..'\r\n|}'
   result = result..'\r\n|-\r\n{| class="wikitable mw-collapsible '..tree..'" style="margin:auto; clear:both; width: 100%"'
   result = result..'\r\n|-\r\n{| class="wikitable mw-collapsible '..tree..'" style="margin:auto; clear:both; width: 100%"'
   result = result..'\r\n!colspan="2"|Trees'
   result = result..'\r\n!colspan="2"|Trees'
   result = result..'\r\n|-\r\n!scope="row"|Seeds'
   result = result..'\r\n|-\r\n!scope="row"|Seeds'
   result = result..'\r\n|style="text-align:center;|'..treeSeeds
   result = result..'\r\n|style="text-align:center;|'..table.concat(treeSeedsTable, ' • ')
   result = result..'\r\n|-\r\n!scope="row"|Produce'
   result = result..'\r\n|-\r\n!scope="row"|Produce'
   result = result..'\r\n|style="text-align:center;|'..treeProduce
   result = result..'\r\n|style="text-align:center;|'..table.concat(treeProduceTable, ' • ')
   result = result..'\r\n|}\r\n|}'
   result = result..'\r\n|}\r\n|}'


444

edits