resolving comments (part 2)

This commit is contained in:
Chr1Z93 2022-12-19 15:15:44 +01:00
parent 43789fdaa7
commit e0fb91809f

View File

@ -11,6 +11,9 @@ optionPanel = {}
-- GUID of data helper
DATA_HELPER_GUID = "708279"
-- GUID of fan-made accessories bag (also just called "barrel")
BARREL_GUID = "aa8b38"
-- GUIDs that will not be interactable (e.g. parts of the table)
local NOT_INTERACTABLE = {
"6161b4",
@ -878,23 +881,20 @@ end
function spawnHelperObject(name, position, rotation, color)
if rotation == nil then rotation = {0, 270, 0} end
local barrel = getObjectFromGUID("aa8b38")
local barrelCopy = barrel.clone({position = barrel.getPosition() + Vector(0, 3, 0)})
for _, obj in ipairs(barrel.getObjects()) do
if obj.name == name then
barrelCopy.takeObject({
index = obj.index,
for _, obj in ipairs(getObjectFromGUID(BARREL_GUID).getData().ContainedObjects) do
if obj["Nickname"] == name then
spawnObjectData({
data = obj,
position = position,
rotation = rotation,
callback_function = function(object)
if name == "Hand Helper" then
Wait.time(function() object.call("externalColorChange", color) end, 1)
elseif name == "Token Arranger" then
Wait.time(function() object.call("layout") end, 1)
end
end,
smooth = false
end
})
barrelCopy.destruct()
return
end
end