17,097
edits
(Testing for 1.0.3) |
(_getObstacleRequirements: Implement) |
||
Line 46: | Line 46: | ||
end | end | ||
return result | return result | ||
end | |||
function p._getObstacleRequirements(obstacle) | |||
local resultPart = {} | |||
if obstacle.category > 0 then | |||
table.insert(resultPart, Icons._SkillReq('Agility', obstacle.category * 10)) | |||
end | |||
if type(obstacle.skillRequirements) == 'table' then | |||
for i, skillReq in ipairs(obstacle.skillRequirements) do | |||
local skillName = Constants.getSkillName(skillReq.skill) | |||
if skillName ~= nil then | |||
table.insert(resultPart, Icons._SkillReq(skillName, skillReq.level)) | |||
end | |||
end | |||
end | |||
return table.concat(resultPart, '<br/>') | |||
end | end | ||
Line 100: | Line 116: | ||
--Grabbing requirements to create | --Grabbing requirements to create | ||
result = result..'||' | result = result..'|| ' .. p._getObstacleRequirements(obst) | ||
--Finally, the cost | --Finally, the cost |