Module:ModifierTables/Sandbox: Difference between revisions

no edit summary
(Creating for the SkillTree module (hope the name is correct))
No edit summary
Line 32: Line 32:
end)
end)
return itemList
return itemList
end
function p.getSkillTreeNodesWithModifier(modifierCriteria)
    local nodesWithModifier = p.getSkillTreeNodes(
        function(node)
            if node.modifiers ~= nil then
                local mods = Modifiers.getMatchingModifiers(node.modifiers, modifierCriteria)
                return not Shared.tableIsEmpty(mods.matched)
            end
            return false
        end
    )
    return nodesWithModifier
end
end


Line 275: Line 288:
table.insert(tableArray, row)
table.insert(tableArray, row)
end
end
local nodeList = p.getSkillTreeNodesWithModifier(modifierCriteria)
for i, node in ipairs(nodeList) do
    local row = {}
    row.name = node.name
    row.icon = Icons.Icon({'SkillTree%23'..string.gsub(node.name, ' ', ''), node.name, type='skill', img='SkillTree'})
    row.expIcon = Icons.getDLCColumnIcon(node.id)
    row.expSort = Icons.getExpansionID(node.id)
    row.type = 'Skill Tree Node'
    row.typeText = 'Skill Tree Node'
    local objMods = nil
    row.modifierText, row.otherModifiers, objMods = getModText(node.modifiers)
    row.val = Modifiers.getModifierValue(objMods.matched)
    if not hasOtherModifiers and not Shared.tableIsEmpty(objMods.unmatched) then
        hasOtherModifiers = true
    end
    table.insert(tableArray, row)
end


local obstList = p.getObstaclesWithModifier(modifierCriteria)
local obstList = p.getObstaclesWithModifier(modifierCriteria)
393

edits