Module:AuronTest/ComparisonTables: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 179: Line 179:
       --Building rows for weapons
       --Building rows for weapons
       table.insert(resultPart, '\r\n|-')
       table.insert(resultPart, '\r\n|-')
       table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0 0 0;"|'..Icons.Icon({item.name, type='item', size=50, notext=true}))
       table.insert(resultPart, '\r\n|style="text-align: left;"|'..Icons.Icon({item.name, type='item', size=50, notext=true}))
       table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0.5em 0 0.5em;"|[['..item.name..']]')
       table.insert(resultPart, '\r\n|style="text-align: left;"|[['..item.name..']]')
       table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;" |'..Shared.formatnum(Items._getItemStat(item, 'attackSpeed', true)))
       table.insert(resultPart, '\r\n| style="text-align: right;" |'..Shared.formatnum(Items._getItemStat(item, 'attackSpeed', true)))
       --That's the first list out of the way, now for 2-Handed
       --That's the first list out of the way, now for 2-Handed
       table.insert(resultPart, '\r\n| style ="text-align: right;"|')
       table.insert(resultPart, '\r\n| style ="text-align: right;"|')
Line 187: Line 187:
       for j, statName in pairs(statColumns) do
       for j, statName in pairs(statColumns) do
         local statValue = Items._getItemStat(item, statName, true)
         local statValue = Items._getItemStat(item, statName, true)
         table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;')
         table.insert(resultPart, '\r\n|style ="text-align: right;')
         if string.find(statName, '^(.+)LevelRequired$') == nil then
         if string.find(statName, '^(.+)LevelRequired$') == nil then
           if statValue > 0 then
           if statValue > 0 then
Line 200: Line 200:
       --If requested, add the item Modifiers
       --If requested, add the item Modifiers
       if includeModifiers then
       if includeModifiers then
         table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap;padding:0 0.5em 0 0.5em;"|')
         table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap;"|')
         table.insert(resultPart, Constants.getModifiersText(item.modifiers, true))
         table.insert(resultPart, Constants.getModifiersText(item.modifiers, true))
       end
       end
       --If requested, add description
       --If requested, add description
       if includeDescription then
       if includeDescription then
         table.insert(resultPart, '\r\n|style="text-align:left;padding:0 0.5em 0 0.5em;"|')
         table.insert(resultPart, '\r\n|style="text-align:left;"|')
         table.insert(resultPart, item.description ~= nil and item.description or '')
         table.insert(resultPart, item.description ~= nil and item.description or '')
       end
       end
       --Finally, the Sources
       --Finally, the Sources
       table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0.5em;" |')
       table.insert(resultPart, '\r\n| style="text-align: right;" |')
       table.insert(resultPart, ItemSourceTables._getItemSources(item))
       table.insert(resultPart, ItemSourceTables._getItemSources(item))
     else
     else
       --Building rows for armour
       --Building rows for armour
       table.insert(resultPart, '\r\n|-')
       table.insert(resultPart, '\r\n|-')
       table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0 0 0;"|'..Icons.Icon({item.name, type='item', size=50, notext=true}))
       table.insert(resultPart, '\r\n|style="text-align: left;"|'..Icons.Icon({item.name, type='item', size=50, notext=true}))
       table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0.5em 0 0.5em;"|[['..item.name..']]')
       table.insert(resultPart, '\r\n|style="text-align: left;"|[['..item.name..']]')
       for j, statName in pairs(statColumns) do
       for j, statName in pairs(statColumns) do
         local statValue = Items._getItemStat(item, statName, true)
         local statValue = Items._getItemStat(item, statName, true)
         table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;')
         table.insert(resultPart, '\r\n| style="text-align: right;')
         if statValue > 0 then
         if statValue > 0 then
           table.insert(resultPart, 'background-color:lightgreen;')
           table.insert(resultPart, 'background-color:lightgreen;')
Line 229: Line 229:
       --If requested, add the item Modifiers
       --If requested, add the item Modifiers
       if includeModifiers then
       if includeModifiers then
         table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap;padding:0 0.5em 0 0.5em;"|')
         table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap;"|')
         table.insert(resultPart, Constants.getModifiersText(item.modifiers, true))
         table.insert(resultPart, Constants.getModifiersText(item.modifiers, true))
       end
       end
       --If requested, add description
       --If requested, add description
       if includeDescription then
       if includeDescription then
         table.insert(resultPart, '\r\n|style="text-align:left;padding:0 0.5em 0 0.5em;"|')
         table.insert(resultPart, '\r\n|style="text-align:left;"|')
         table.insert(resultPart, item.description ~= nil and item.description or '')
         table.insert(resultPart, item.description ~= nil and item.description or '')
       end
       end
       --Finally, the Sources
       --Finally, the Sources
       table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0.5em;" |')
       table.insert(resultPart, '\r\n| style ="text-align: right;" |')
       table.insert(resultPart, ItemSourceTables._getItemSources(item))
       table.insert(resultPart, ItemSourceTables._getItemSources(item))
     end
     end