Module:Crafting: Difference between revisions
m 1 revision imported |
No edit summary |
||
| Line 139: | Line 139: | ||
for _, itemSet in pairs(itemSets) do | for _, itemSet in pairs(itemSets) do | ||
for _, item in pairs(itemSet) do | for _, item in pairs(itemSet) do | ||
--local name = item.mod .. ":" .. item.name -- use instead of just item.name if mods are covered | --local name = item.mod .. ":" .. item.name -- use instead of just item.name if mods are covered\ | ||
if not usedNames[ | local displayName = item.name:gsub("%.gif$", "") | ||
table.insert(retTable, | if not usedNames[displayName] then | ||
table.insert(inputRetTable, | table.insert(retTable, displayName) | ||
usedNames[ | table.insert(inputRetTable, displayName) | ||
usedNames[displayName] = true | |||
if aliases[ | if aliases[displayName] then | ||
for _, aliasEntry in ipairs(aliases[ | for _, aliasEntry in ipairs(aliases[displayName]) do | ||
if not usedNames[aliasEntry] then | if not usedNames[aliasEntry] then | ||
table.insert(retTable, (aliasEntry.name or aliasEntry)) -- Sometimes the alias entry is a table, so try and grab its name from within the table with a fallback to just the entry. | table.insert(retTable, (aliasEntry.name or aliasEntry)) -- Sometimes the alias entry is a table, so try and grab its name from within the table with a fallback to just the entry. | ||