12,868
edits
Falterfire (talk | contribs) (Added ability to specifically exclude items from a given category) |
(_getCategoryTable: Fix skill cape classification for Superior Cape of Completion) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
local styleOverrides = { | local styleOverrides = { | ||
Melee = {'Slayer Helmet (Basic)', 'Slayer Platebody (Basic)', 'Paladin Gloves', 'Desert Wrappings', 'Almighty Lute', 'Candy Cane', 'Bob's Rake', "Knight's Defender"}, | Melee = {'Slayer Helmet (Basic)', 'Slayer Platebody (Basic)', 'Paladin Gloves', 'Desert Wrappings', 'Almighty Lute', 'Candy Cane', 'Bob's Rake', "Knight's Defender", "Ward of Flame Platebody"}, | ||
Ranged = {'Slayer Cowl (Basic)', 'Slayer Leather Body (Basic)', 'Ice Arrows'}, | Ranged = {'Slayer Cowl (Basic)', 'Slayer Leather Body (Basic)', 'Ice Arrows'}, | ||
Magic = {'Slayer Wizard Hat (Basic)', 'Slayer Wizard Robes (Basic)', 'Enchanted Shield', 'Elementalist Gloves', 'Frostspark Boots'}, | Magic = {'Slayer Wizard Hat (Basic)', 'Slayer Wizard Robes (Basic)', 'Enchanted Shield', 'Elementalist Gloves', 'Frostspark Boots', 'Freezing Touch Body', 'Lightning Boots'}, | ||
None = {}, | None = {}, | ||
NotMelee = {'Frostspark Boots'}, | NotMelee = {'Frostspark Boots', 'Freezing Touch Body', 'Lightning Boots'}, | ||
NotRanged = {}, | NotRanged = {}, | ||
NotMagic = {'Torrential Blast Crossbow', 'Spectral Ice Sword', 'Lightning Strike 1H Sword', 'FrostSpark 1H Sword'} | NotMagic = {'Torrential Blast Crossbow', 'Spectral Ice Sword', 'Lightning Strike 1H Sword', 'FrostSpark 1H Sword'} | ||
Line 177: | Line 177: | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|style="text-align: centre;"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | table.insert(resultPart, '\r\n|style="text-align: centre;"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | ||
table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', noicon=true})) | table.insert(resultPart, '\r\n|' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})) | ||
table.insert(resultPart, '\r\n| data-sort-value="' .. atkSpeed .. '" style="text-align:right;" |'..Shared.round(atkSpeed / 1000, 3, 1) .. 's') | table.insert(resultPart, '\r\n| data-sort-value="' .. atkSpeed .. '" style="text-align:right;" |'..Shared.round(atkSpeed / 1000, 3, 1) .. 's') | ||
--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 | ||
Line 184: | Line 184: | ||
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;') | table.insert(resultPart, '\r\n| style="text-align:right;" class="') | ||
if string.find(statName, '^(.+)LevelRequired$') == nil then | if string.find(statName, '^(.+)LevelRequired$') == nil then | ||
if statValue > 0 then | if statValue > 0 then | ||
table.insert(resultPart, ' | table.insert(resultPart, 'table-positive') | ||
elseif statValue < 0 then | elseif statValue < 0 then | ||
table.insert(resultPart, ' | table.insert(resultPart, 'table-negative') | ||
end | end | ||
end | end | ||
Line 223: | Line 223: | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | ||
table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', noicon=true})) | table.insert(resultPart, '\r\n|' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})) | ||
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;') | table.insert(resultPart, '\r\n|style="text-align:right;" class="') | ||
if statValue > 0 then | if statValue > 0 then | ||
table.insert(resultPart, ' | table.insert(resultPart, 'table-positive') | ||
elseif statValue < 0 then | elseif statValue < 0 then | ||
table.insert(resultPart, ' | table.insert(resultPart, 'table-negative') | ||
end | end | ||
table.insert(resultPart, '"|'..Shared.formatnum(statValue)) | table.insert(resultPart, '"|'..Shared.formatnum(statValue)) | ||
Line 296: | Line 296: | ||
if isMatch and other ~= nil then | if isMatch and other ~= nil then | ||
if slot == 'Cape' then | if slot == 'Cape' then | ||
local isSkillcape = Shared.contains(item.name, 'Skillcape') or item.name | -- TODO Would be more reliable if based on items appearing within the relevant shop categories instead | ||
local isSkillcape = Shared.contains(item.name, 'Skillcape') or Shared.contains(item.name, 'Cape of Completion') | |||
if other == 'Skillcapes' then | if other == 'Skillcapes' then | ||
isMatch = isSkillcape | isMatch = isSkillcape | ||
Line 396: | Line 397: | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | table.insert(resultPart, '\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | ||
table.insert(resultPart, '||'..Icons.Icon({item.name, type='item', noicon=true})) | table.insert(resultPart, '||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})) | ||
table.insert(resultPart, '||style ="text-align: right;" data-sort-value="'..lootValue..'"|'..lootValue..'%') | table.insert(resultPart, '||style ="text-align: right;" data-sort-value="'..lootValue..'"|'..lootValue..'%') | ||
table.insert(resultPart, '||'..(Constants.getDescription(item.customDescription, item.modifiers) or '')) | table.insert(resultPart, '||'..(Constants.getDescription(item.customDescription, item.modifiers) or '')) | ||
Line 496: | Line 497: | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', size='50', notext=true})) | table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', size='50', notext=true})) | ||
table.insert(resultPart, '||'..Icons.Icon({item.name, type='item', noicon=true})) | table.insert(resultPart, '||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})) | ||
local matArray = {} | local matArray = {} |