1,131
edits
No edit summary |
No edit summary |
||
| Line 67: | Line 67: | ||
-- Create the rows for the output table | -- Create the rows for the output table | ||
for _, shop in ipairs(data) do | for _, shop in ipairs(data) do | ||
for i, location in ipairs(shop.location) do | for i, location in ipairs(shop.location) do | ||
addShopRow(shop, location) | addShopRow(shop, location) | ||
| Line 115: | Line 113: | ||
end | end | ||
mw.log(string.format('SMW (store locations list): entries: %d, time elapsed: %.3f ms.', #smwdata, (t2 - t1) * 1000)) | mw.log(string.format('SMW (store locations list): entries: %d, time elapsed: %.3f ms.', #smwdata, (t2 - t1) * 1000)) | ||
table.sort(smwdata, function(a, b) return b['Store sell price'] < a['Store sell price'] end) | table.sort(smwdata, function(a, b) return b['Store sell price'] < a['Store sell price'] end) | ||
| Line 129: | Line 125: | ||
table.insert(members, item['Is members only']) | table.insert(members, item['Is members only']) | ||
elseif type(item['Is members only']) == 'string' then | elseif type(item['Is members only']) == 'string' then | ||
table.insert(members, item['Members']) | table.insert(members, item['Members']) | ||
end | end | ||
| Line 150: | Line 145: | ||
-- item['Region'] = region | -- item['Region'] = region | ||
if #members == 1 then | if #members == 1 then | ||
| Line 166: | Line 158: | ||
-- Process the item and add it to the final data table | -- Process the item and add it to the final data table | ||
local dataline = p.processData(item, editbtn) | local dataline = p.processData(item, editbtn) | ||
table.insert(data, dataline) | table.insert(data, dataline) | ||
| Line 243: | Line 233: | ||
-- members only? | -- members only? | ||
local members = item['Members'] | local members = item['Members'] | ||
if type(members) == 'table' then | if type(members) == 'table' then | ||
-- contains yes and/or no | -- contains yes and/or no | ||
| Line 274: | Line 260: | ||
members = editbtn | members = editbtn | ||
end | end | ||
return { | return { | ||