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