From c103f5a9afff6c59ae37b39ac0083ea93456b062 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Fri, 19 Nov 2021 21:08:35 -0500 Subject: [PATCH] crafting icon sort goes in ascending order --- eid_api.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index 2b82c9ca..c77a8798 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -829,11 +829,11 @@ 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}}" +-- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}" function EID:tableToCraftingIconsFull(craftTable, sortTable) if (sortTable == nil) then sortTable = true end local sortedList = {table.unpack(craftTable)} - if (sortTable) then table.sort(sortedList, function(a, b) return a > b end) 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.."}}" @@ -843,7 +843,7 @@ end -- Converts a given table into a string containing the crafting icons of the table, which are also grouped to reduce render lag -- Example input: {1,1,1,2,2,3,3,3} --- Result: "3{{Crafting3}}2{{Crafting2}}3{{Crafting1}}" +-- Result: "3{{Crafting1}}2{{Crafting2}}3{{Crafting3}}" local emptyPickupTable = {} for i=1,29 do emptyPickupTable[i] = 0 end function EID:tableToCraftingIconsMerged(craftTable)