Module:Calculator/AgilityObstacle: Difference between revisions

Update for v1.3
(Add expansion icon to obstacle)
(Update for v1.3)
Line 4: Line 4:
local Num = require('Module:Number')
local Num = require('Module:Number')
local Constants = require('Module:Constants')
local Constants = require('Module:Constants')
local Modifiers = require('Module:Modifiers')
local Agility = require('Module:Skills/Agility')
local Agility = require('Module:Skills/Agility')
local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
Line 231: Line 232:
--== Local Functions for formatting Obstacle MetaData ==--
--== Local Functions for formatting Obstacle MetaData ==--
local function getBonusses(obstacle)
local function getBonusses(obstacle)
local bonuses = {}
if obstacle.modifiers == nil then
for bonusName, bonusValue in pairs(obstacle.modifiers) do
return '<span style="color:red">None :(</span>'
table.insert(bonuses, Constants._getModifierText(bonusName, bonusValue))
else
end
return Modifiers.getModifiersText(obstacle.modifiers, true, false, 10)
if Shared.tableIsEmpty(bonuses) then
table.insert(bonuses, '<span style="color:red">None :(</span>')
end
end
return table.concat(bonuses, '<br/>')
end
end
Line 271: Line 269:
local function getTotalBonuses(obstacles)
local function getTotalBonuses(obstacles)
--[==[
local bonuses = {}
local bonuses = {}
for _, obstacle in pairs(obstacles) do
for _, obstacle in pairs(obstacles) do
Line 289: Line 288:
return table.concat(ret, '<br/>')
return table.concat(ret, '<br/>')
--]==]
return ''
end
end