Module:Common: Difference between revisions

Add getEquipmentSlotLink function
(Add getEquipmentSlotPage function)
(Add getEquipmentSlotLink function)
Line 55: Line 55:
}
}
return slotLinkMap[equipSlot]
return slotLinkMap[equipSlot]
end
end
-- getEquipmentSlotLink: As with getEquipmentSlotPage(), except returns wikitext to link to the
-- relevant page.
function p.getEquipmentSlotLink(equipSlot)
local pageName = p.getEquipmentSlotPage(equipSlot)
if pageName ~= nil then
return '[[' .. pageName .. '|' .. equipSlot .. ']]'
else
return equipSlot
end
end
end
end