Anonymous

Module:Constants: Difference between revisions

From Melvor Idle
Added p.getModifiersText which should replace duplicated code in a few places.
(Added ability to mark modifiers as affecting specific skills)
(Added p.getModifiersText which should replace duplicated code in a few places.)
Line 291: Line 291:


   return p._getModifierText(modifier, value, doColor)
   return p._getModifierText(modifier, value, doColor)
end
function p.getModifiersText(modifiers, doColor)
  if modifiers == nil or #modifiers == 0 then
    return ''
  end
  local modArray = {}
  for bonus, value in Shared.skpairs(modifiers) do
    table.insert(modArray, p._getModifierText(bonus, value, doColor))
  end
  return table.concat(modArray, "<br/>")
end
end