Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
_getMonsterTable: Add excludeDungeons parameter & show dungeons on full monster table
(Fixed Ahrenia's GP range being weird)
(_getMonsterTable: Add excludeDungeons parameter & show dungeons on full monster table)
Line 932: Line 932:
     return ''
     return ''
   else
   else
     return p._getMonsterTable(monsterIDs)
     return p._getMonsterTable(monsterIDs, true)
   end
   end
end
end
Line 942: Line 942:
   end
   end


   return p._getMonsterTable(monsterIDs)
   return p._getMonsterTable(monsterIDs, false)
end
end


function p._getMonsterTable(monsterIDs)
function p._getMonsterTable(monsterIDs, excludeDungeons)
   --Making a single function for getting a table of monsters given a list of IDs.
   --Making a single function for getting a table of monsters given a list of IDs.
  local hideDungeons = excludeDungeons ~= nil and excludeDungeons or false
   local tableTxt = '{| class="wikitable sortable stickyHeader"'
   local tableTxt = '{| class="wikitable sortable stickyHeader"'
   -- First header row
   -- First header row
Line 999: Line 1,000:
     tableTxt = tableTxt .. '\r\n|style="text-align:right" data-sort-value="' .. (gpRange[1] + gpRange[2]) / 2 .. '" |' .. gpTxt
     tableTxt = tableTxt .. '\r\n|style="text-align:right" data-sort-value="' .. (gpRange[1] + gpRange[2]) / 2 .. '" |' .. gpTxt
     tableTxt = tableTxt .. '\r\n|style="text-align:center" |' .. boneTxt
     tableTxt = tableTxt .. '\r\n|style="text-align:center" |' .. boneTxt
     tableTxt = tableTxt .. '\r\n|style="text-align:right;white-space:nowrap" |' .. p._getMonsterAreas(monster, true)
     tableTxt = tableTxt .. '\r\n|style="text-align:right;white-space:nowrap" |' .. p._getMonsterAreas(monster, hideDungeons)
   end
   end