Module:CombatAreas: Difference between revisions

added getAreaRequirementsForBox
(Refactor _getAreaRequirements & drop dependency on Shop, Items modules)
(added getAreaRequirementsForBox)
Line 83: Line 83:


return table.concat(resultArray, '<br/>')
return table.concat(resultArray, '<br/>')
end
function p.getAreaRequirementsForBox(frame)
--Returns infobox formatting for requirements, or returns nothing if there are none.
local areaName = frame.args ~= nil and frame.args[1] or frame
local area = p.getArea(areaName)
if area == nil then
return Shared.printError('No area named "' .. areaName .. '" exists in the data module')
end
local reqs = p._getAreaRequirements(area)
if reqs ~= '' then
reqs = "|-\r\n|'''Requirements:'''\r\n"..reqs
end
return reqs
end
end