Anonymous

Module:Items/SourceTables: Difference between revisions

From Melvor Idle
m
Add custom separator for ItemSources
(Implement sandbox changes that add level requirements to table)
m (Add custom separator for ItemSources)
Line 292: Line 292:
end
end


function p._getItemSources(item, asList, addCategories)
function p._getItemSources(item, asList, addCategories, separator)
local lineArray = {}
local lineArray = {}
local categoryArray = {}
local categoryArray = {}
local sep = separator or ','


--Alright, time to go through all the ways you can get an item...
--Alright, time to go through all the ways you can get an item...
Line 350: Line 351:


if not Shared.tableIsEmpty(dungeonStrPart) then
if not Shared.tableIsEmpty(dungeonStrPart) then
table.insert(lineArray, 'Completing: ' .. table.concat(dungeonStrPart, ','))
table.insert(lineArray, 'Completing: ' .. table.concat(dungeonStrPart, sep))
end
end
if not Shared.tableIsEmpty(killStrPart) then
if not Shared.tableIsEmpty(killStrPart) then
table.insert(lineArray, 'Killing: ' .. table.concat(killStrPart, ','))
table.insert(lineArray, 'Killing: ' .. table.concat(killStrPart, sep))
end
end


Line 370: Line 371:


if not Shared.tableIsEmpty(lootPart) then
if not Shared.tableIsEmpty(lootPart) then
table.insert(lineArray, 'Opening: ' .. table.concat(lootPart, ','))
table.insert(lineArray, 'Opening: ' .. table.concat(lootPart, sep))
end
end


Line 395: Line 396:
end
end
local typeText = (catName == 'up' and 'Upgrading') or 'Downgrading'
local typeText = (catName == 'up' and 'Upgrading') or 'Downgrading'
table.insert(lineArray, typeText .. ': ' .. table.concat(parts, ','))
table.insert(lineArray, typeText .. ': ' .. table.concat(parts, sep))
end
end
end
end
Line 414: Line 415:
end
end
if not Shared.tableIsEmpty(thiefPart) then
if not Shared.tableIsEmpty(thiefPart) then
table.insert(lineArray, 'Pickpocketing: ' .. table.concat(thiefPart, ','))
table.insert(lineArray, 'Pickpocketing: ' .. table.concat(thiefPart, sep))
end
end
end
end
Line 424: Line 425:
end
end
if not Shared.tableIsEmpty(castPart) then
if not Shared.tableIsEmpty(castPart) then
table.insert(lineArray, 'Casting: ' .. table.concat(castPart, ','))
table.insert(lineArray, 'Casting: ' .. table.concat(castPart, sep))
end
end


2,875

edits