diff --git a/eid_api.lua b/eid_api.lua index 4734f6f7..a8741007 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -829,9 +829,10 @@ end -- Converts a given table into a string containing the crafting icons of the table -- Example input: {1,2,3,4,5,6,7,8} -- Result: "{{Crafting8}}{{Crafting7}}{{Crafting6}}{{Crafting5}}{{Crafting4}}{{Crafting3}}{{Crafting2}}{{Crafting1}}" -function EID:tableToCraftingIconsFull(craftTable) +function EID:tableToCraftingIconsFull(craftTable, sortTable) + if (sortTable == nil) then sortTable = true end local sortedList = {table.unpack(craftTable)} - table.sort(sortedList, function(a, b) return a > b end) + if (sortTable) then table.sort(sortedList, function(a, b) return a > b end) end local iconString = "" for _,nr in ipairs(sortedList) do iconString = iconString.."{{Crafting"..nr.."}}" @@ -846,7 +847,6 @@ local emptyPickupTable = {} for i=1,29 do emptyPickupTable[i] = 0 end function EID:tableToCraftingIconsMerged(craftTable) local sortedList = {table.unpack(craftTable)} - table.sort(sortedList, function(a, b) return a > b end) local filteredList = {table.unpack(emptyPickupTable)} for _,nr in ipairs(sortedList) do filteredList[nr] = filteredList[nr] +1