Module:Crafting: Difference between revisions

No edit summary
I give up trying to make gifs work here for right now, I'll try again later once I understand Lua better
Tag: Manual revert
 
Line 140: Line 140:
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
local raw = item.name
if not usedNames[item.name] then
local name = raw:gsub('%.png$', '')
table.insert(retTable, item.name)
table.insert(inputRetTable, item.name)
if not usedNames[name] then
usedNames[item.name] = true
table.insert(retTable, name)
table.insert(inputRetTable, name)
usedNames[name] = true
if aliases[name] then
if aliases[item.name] then
for _, aliasEntry in ipairs(aliases[name]) do
for _, aliasEntry in ipairs(aliases[item.name]) do
if not usedNames[aliasEntry] then
local aliasName = (aliasEntry.name or aliasEntry):gsub("%.gif$", "")
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.
if not usedNames[aliasName] then
table.insert(retTable, aliasName) -- Sometimes the alias entry is a table, so try and grab its name from within the table with a fallback to just the entry.
usedNames[aliasEntry] = true
usedNames[aliasEntry] = true
end
end