Added implementation of Bag of Crafting description
This commit is contained in:
1 parent
51b22b38b4
commit
c1d6b3aea9
7 files changed
+615
-25
No files matched your search
+33
@@ -708,6 +708,39 @@ function EID:getSpindownResult(collectibleID)
|
||||
return newID
|
||||
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)
|
||||
table.sort(craftTable, function(a, b) return a > b end)
|
||||
local iconString = ""
|
||||
for _,nr in ipairs(craftTable) do
|
||||
iconString = iconString.."{{Crafting"..nr.."}}"
|
||||
end
|
||||
return iconString
|
||||
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}}"
|
||||
function EID:tableToCraftingIconsMerged(craftTable)
|
||||
table.sort(craftTable, function(a, b) return a > b end)
|
||||
filteredList = {}
|
||||
for _,nr in ipairs(craftTable) do
|
||||
if filteredList[nr] == nil then
|
||||
filteredList[nr] = 1
|
||||
else
|
||||
filteredList[nr] = filteredList[nr] +1
|
||||
end
|
||||
end
|
||||
local iconString = ""
|
||||
for nr,count in pairs(filteredList) do
|
||||
iconString = iconString..count.."{{Crafting"..nr.."}}"
|
||||
end
|
||||
return iconString
|
||||
end
|
||||
|
||||
|
||||
-- Creates a copy of a KColor object. This prevents overwriting existing
|
||||
function EID:copyKColor(colorObj)
|
||||
return KColor(colorObj.Red, colorObj.Green, colorObj.Blue, colorObj.Alpha)
|
||||
|
||||
Reference in new issue
Block a user