Anonymous

Module:ModifierTables: Difference between revisions

From Melvor Idle
_getModifierTable: Add equipment slot links to type column
(_getModifierTable: Add Cartography hex mastery bonuses)
(_getModifierTable: Add equipment slot links to type column)
 
Line 6: Line 6:
local Constants = require('Module:Constants')
local Constants = require('Module:Constants')
local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local Common = require('Module:Common')
local Pets = require('Module:Pets')
local Pets = require('Module:Pets')
local Items = require('Module:Items')
local Items = require('Module:Items')
Line 329: Line 330:
row.expIcon = Icons.getExpansionIcon(item.id)
row.expIcon = Icons.getExpansionIcon(item.id)
row.type = 'Item'
row.type = 'Item'
row.typeText = row.type
--For equipment, show the slot they go in
--For equipment, show the slot they go in
if item.validSlots ~= nil then
if item.validSlots ~= nil and not Shared.tableIsEmpty(item.validSlots) then
row.type = row.type..' ('..table.concat(Shared.clone(item.validSlots), ', ')..')'
local rowTypePart = {}
for j, slot in ipairs(item.validSlots) do
table.insert(rowTypePart, Common.getEquipmentSlotLink(slot))
end
row.typeText = row.typeText .. ' (' .. table.concat(item.validSlots, ', ') .. ')'
row.type = row.type .. ' (' .. table.concat(rowTypePart, ', ') .. ')'
end
end
row.typeText = row.type
local totalVal = 0
local totalVal = 0
for i, mod in pairs(modifiers) do
for i, mod in pairs(modifiers) do