bugfix for handhelper, error handling for missing barrel
This commit is contained in:
parent
d5f04cf465
commit
20e0f8075b
@ -1 +1 @@
|
||||
{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":false,"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true}}
|
||||
{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":{},"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true}}
|
||||
|
@ -885,13 +885,21 @@ end
|
||||
---@param name String Name of the object that should be copied
|
||||
---@param position Position Desired position of the object
|
||||
function spawnHelperObject(name, position, rotation, color)
|
||||
local barrel = getObjectFromGUID(BARREL_GUID)
|
||||
|
||||
-- error handling for missing barrel
|
||||
if not barrel then
|
||||
broadcastToAll("'Barrel' with fan-made accessories could not be found!", "Red")
|
||||
return
|
||||
end
|
||||
|
||||
local spawnTable = {
|
||||
position = position,
|
||||
callback_function = function(object)
|
||||
if name == "Hand Helper" then
|
||||
Wait.time(function() object.call("externalColorChange", color) end, 1)
|
||||
Wait.time(function() object.call("externalColorChange", color) end, 0.1)
|
||||
elseif name == "Token Arranger" then
|
||||
Wait.time(function() object.call("layout") end, 1)
|
||||
Wait.time(function() object.call("layout") end, 0.1)
|
||||
end
|
||||
end
|
||||
}
|
||||
@ -901,7 +909,7 @@ function spawnHelperObject(name, position, rotation, color)
|
||||
spawnTable.rotation = rotation
|
||||
end
|
||||
|
||||
for _, obj in ipairs(getObjectFromGUID(BARREL_GUID).getData().ContainedObjects) do
|
||||
for _, obj in ipairs(barrel.getData().ContainedObjects) do
|
||||
if obj["Nickname"] == name then
|
||||
spawnTable.data = obj
|
||||
return spawnObjectData(spawnTable)
|
||||
@ -955,7 +963,7 @@ function onClick_defaultSettings()
|
||||
useClueClickers = false,
|
||||
showTokenArranger = false,
|
||||
showCleanUpHelper = false,
|
||||
showHandHelper = false,
|
||||
showHandHelper = {},
|
||||
showChaosBagManager = false,
|
||||
showNavigationOverlay = false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user