Module:Items: Difference between revisions

148 bytes removed ,  23 September 2020
More formatting fixes
(more formatting fixes)
(More formatting fixes)
Line 456: Line 456:
           local statValue = p._getItemStat(item, statName, true)
           local statValue = p._getItemStat(item, statName, true)
           result = result..'\r\n| style ="text-align: right;padding: 0 0.5em 0 0;'
           result = result..'\r\n| style ="text-align: right;padding: 0 0.5em 0 0;'
          if statValue > 0 then
            result = result..'background-color:lightgreen;'
          elseif statValue < 0 then
            result = result..'background-color:lightpink;'
          end
           result = result..'"|'..Shared.formatnum(statValue)
           result = result..'"|'..Shared.formatnum(statValue)
           if statName == 'magicDamageBonus' or statName == 'damageReduction' then result = result..'%' end
           if statName == 'magicDamageBonus' or statName == 'damageReduction' then result = result..'%' end
Line 492: Line 487:
           local statValue = p._getItemStat(item, statName, true)
           local statValue = p._getItemStat(item, statName, true)
           result = result..'\r\n| style ="text-align: right;padding: 0 0.5em 0 0;'
           result = result..'\r\n| style ="text-align: right;padding: 0 0.5em 0 0;'
           if statValue > 0 then
           if j == 1 then
            result = result..'background-color:lightgreen;'
            if statValue > 0 then
          elseif statValue < 0 then
              result = result..'background-color:lightgreen;'
            result = result..'background-color:lightpink;'
            elseif statValue < 0 then
              result = result..'background-color:lightpink;'
            end
           end
           end
           result = result..'"|'..Shared.formatnum(statValue)
           result = result..'"|'..Shared.formatnum(statValue)
Line 507: Line 504:
   end
   end


   result = result..'|}'
   result = result..'\r\n|}'
   return result
   return result
end
end


return p
return p