Module:Common: Difference between revisions

Cleanup migrated functions
(getPurchaseIcon: Amend logic for certain item bundles introduced in V1.2.2)
(Cleanup migrated functions)
Tag: Manual revert
 
(9 intermediate revisions by 2 users not shown)
Line 29: Line 29:
return skillData.skillID
return skillData.skillID
end
end
end
end
-- getEquipmentSlotPage: Given a valid equipment slot ID, returns the page name for that slot's
-- equipment. If the slot is not recognized, then nil is returned
function p.getEquipmentSlotPage(equipSlot)
if type(equipSlot) == 'string' then
local slotLinkMap = {
["Helmet"] = 'Helmets',
["Platebody"] = 'Platebodies',
["Platelegs"] = 'Platelegs',
["Boots"] = 'Boots',
["Gloves"] = 'Gloves',
["Cape"] = 'Capes',
["Amulet"] = 'Amulets',
["Ring"] = 'Rings',
["Gem"] = 'Gems (Equipment)',
["Weapon"] = 'Weapons',
["Shield"] = 'Shields',
["Quiver"] = 'Ammunition',
["Consumable"] = 'Consumables',
["Passive"] = 'Combat Passive Slot',
["Summon1"] = 'Summoning',
["Summon2"] = 'Summoning'
}
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
1,010

edits