update group of helper handling
This commit is contained in:
parent
6d1bf009b5
commit
c5dd28525c
@ -1 +1 @@
|
||||
{"acknowledgedUpgradeVersions":[],"chaosTokensGUID":[],"optionPanel":{"cardLanguage":"en","changePlayAreaImage":false,"playAreaConnectionColor":{"a":1,"b":0.4,"g":0.4,"r":0.4},"playAreaConnections":true,"playAreaSnapTags":true,"showAttachmentHelper":false,"showCleanUpHelper":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showSearchAssistant":[],"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}
|
||||
{"acknowledgedUpgradeVersions":[],"chaosTokensGUID":[],"optionPanel":{"cardLanguage":"en","playAreaConnectionColor":{"a":1,"b":0.4,"g":0.4,"r":0.4},"playAreaConnections":true,"playAreaSnapTags":true,"showAttachmentHelper":false,"showCleanUpHelper":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":false,"showSearchAssistant":false,"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}
|
||||
|
@ -1367,24 +1367,12 @@ function applyOptionPanelChange(id, state)
|
||||
|
||||
-- option: Show hand helper for each player
|
||||
elseif id == "showHandHelper" then
|
||||
local helperName = "Hand Helper"
|
||||
local spawnData = playmatApi.getHelperSpawnData("All", helperName)
|
||||
|
||||
for color, data in pairs(spawnData) do
|
||||
spawnOrRemoveHelper(state, helperName, data.position, data.rotation, color)
|
||||
end
|
||||
|
||||
spawnOrRemoveHelperForPlayermats("Hand Helper", state)
|
||||
optionPanel[id] = state
|
||||
|
||||
-- option: Show search assistant for each player
|
||||
elseif id == "showSearchAssistant" then
|
||||
local helperName = "Search Assistant"
|
||||
local spawnData = playmatApi.getHelperSpawnData("All", helperName)
|
||||
|
||||
for color, data in pairs(spawnData) do
|
||||
spawnOrRemoveHelper(state, helperName, data.position, data.rotation, color)
|
||||
end
|
||||
|
||||
spawnOrRemoveHelperForPlayermats("Search Assistant", state)
|
||||
optionPanel[id] = state
|
||||
|
||||
-- option: Show attachment helper
|
||||
@ -1401,6 +1389,15 @@ function applyOptionPanelChange(id, state)
|
||||
end
|
||||
end
|
||||
|
||||
-- spawns or removes a helper object for all playermats
|
||||
---@param helperName string Name of the helper object
|
||||
---@param state boolean Contains the state of the option: true = spawn it, false = remove it
|
||||
function spawnOrRemoveHelperForPlayermats(helperName, state)
|
||||
for color, data in pairs(playmatApi.getHelperSpawnData("All", helperName)) do
|
||||
spawnOrRemoveHelper(state, helperName, data.position, data.rotation, color)
|
||||
end
|
||||
end
|
||||
|
||||
-- handler for spawn / remove functions of helper objects
|
||||
---@param state boolean Contains the state of the option: true = spawn it, false = remove it
|
||||
---@param name string Name of the helper object
|
||||
@ -1424,7 +1421,7 @@ end
|
||||
---@param position tts__Vector Desired position of the object
|
||||
---@param rotation? tts__Vector Desired rotation of the object (defaults to object's rotation)
|
||||
function spawnHelperObject(name, position, rotation)
|
||||
local sourceBag = guidReferenceApi.getObjectByOwnerAndType("Mythos","OptionPanelSource")
|
||||
local sourceBag = guidReferenceApi.getObjectByOwnerAndType("Mythos", "OptionPanelSource")
|
||||
|
||||
-- error handling for missing sourceBag
|
||||
if not sourceBag then
|
||||
@ -1487,7 +1484,7 @@ function onClick_defaultSettings()
|
||||
-- clean reset of variables
|
||||
optionPanel = {
|
||||
cardLanguage = "en",
|
||||
playAreaConnectionColor = { 0.4, 0.4, 0.4, 1 },
|
||||
playAreaConnectionColor = { a = 1, b = 0.4, g = 0.4, r = 0.4 },
|
||||
playAreaConnections = true,
|
||||
playAreaSnapTags = true,
|
||||
showAttachmentHelper = false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user