4,951
edits
Falterfire (talk | contribs) (added 'buildItemGrid') |
Falterfire (talk | contribs) (Added a check to allow for retrieving items with # in the name) |
||
Line 78: | Line 78: | ||
name = string.gsub(name, "'", "'") | name = string.gsub(name, "'", "'") | ||
for i, item in pairs(ItemData.Items) do | for i, item in pairs(ItemData.Items) do | ||
if(item.name == | local itemName = string.gsub(item.name, '#', '') | ||
if(item.name == itemName) then | |||
result = Shared.clone(item) | result = Shared.clone(item) | ||
--Make sure every item has an id, and account for Lua being 1-index | --Make sure every item has an id, and account for Lua being 1-index | ||
Line 1,965: | Line 1,966: | ||
end | end | ||
function p. | function p.getItemGrid(frame) | ||
result = '{|' | result = '{|' | ||
for i, item in Shared.skpairs(ItemData.Items) do | for i, item in Shared.skpairs(ItemData.Items) do |