Anonymous

Module:Items/SourceTables/Sandbox: Difference between revisions

From Melvor Idle
m
Sort on numeric level value
m (Remove Source Type column in favour of Level column)
m (Sort on numeric level value)
Line 800: Line 800:
table.insert(rowPart, '\r\n|style="text-align: left;"|'..source)
table.insert(rowPart, '\r\n|style="text-align: left;"|'..source)
--Weeding out brackets since they don't play nice with data-sort-value
--Weeding out brackets since they don't play nice with data-sort-value
local _, _, levelText = string.find(level, "%|([%a%s]+)%]")
local levelValue = level:match("Level (%d+)")
if levelText == nil then _, _, levelText = string.find(level, "%[%[([%a%s]+)%]") end
table.insert(rowPart, '\r\n|style="text-align: left;" data-sort-value="'..levelValue..'"|'..expIcon.. level)
if levelText == nil then levelText = level end
table.insert(rowPart, '\r\n|style="text-align: left;" data-sort-value="'..levelText..'"|'..expIcon.. level)
table.insert(rowPart, '\r\n|style="text-align: right;" data-sort-value="'..qty..'"|'..Shared.formatnum(minqty))
table.insert(rowPart, '\r\n|style="text-align: right;" data-sort-value="'..qty..'"|'..Shared.formatnum(minqty))
if qty ~= minqty then table.insert(rowPart, ' - '..Shared.formatnum(qty)) end
if qty ~= minqty then table.insert(rowPart, ' - '..Shared.formatnum(qty)) end
2,875

edits