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,14 +885,22 @@ end
|
|||||||
---@param name String Name of the object that should be copied
|
---@param name String Name of the object that should be copied
|
||||||
---@param position Position Desired position of the object
|
---@param position Position Desired position of the object
|
||||||
function spawnHelperObject(name, position, rotation, color)
|
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 = {
|
local spawnTable = {
|
||||||
position = position,
|
position = position,
|
||||||
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, 0.1)
|
||||||
elseif name == "Token Arranger" then
|
elseif name == "Token Arranger" then
|
||||||
Wait.time(function() object.call("layout") end, 1)
|
Wait.time(function() object.call("layout") end, 0.1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -901,7 +909,7 @@ function spawnHelperObject(name, position, rotation, color)
|
|||||||
spawnTable.rotation = rotation
|
spawnTable.rotation = rotation
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, obj in ipairs(getObjectFromGUID(BARREL_GUID).getData().ContainedObjects) do
|
for _, obj in ipairs(barrel.getData().ContainedObjects) do
|
||||||
if obj["Nickname"] == name then
|
if obj["Nickname"] == name then
|
||||||
spawnTable.data = obj
|
spawnTable.data = obj
|
||||||
return spawnObjectData(spawnTable)
|
return spawnObjectData(spawnTable)
|
||||||
@ -955,7 +963,7 @@ function onClick_defaultSettings()
|
|||||||
useClueClickers = false,
|
useClueClickers = false,
|
||||||
showTokenArranger = false,
|
showTokenArranger = false,
|
||||||
showCleanUpHelper = false,
|
showCleanUpHelper = false,
|
||||||
showHandHelper = false,
|
showHandHelper = {},
|
||||||
showChaosBagManager = false,
|
showChaosBagManager = false,
|
||||||
showNavigationOverlay = false
|
showNavigationOverlay = false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user