unselect objects after searching

This commit is contained in:
Chr1Z93 2024-07-08 12:47:03 +02:00
parent bf4fcd6051
commit a2e07964e3

View File

@ -160,8 +160,8 @@ function getRandomSeed()
return math.random(999)
end
-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag
-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the
-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag
-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the
-- chaos bag during search operations to avoid this.
function onObjectSearchStart(object, playerColor)
local chaosBag = findChaosBag()
@ -170,14 +170,15 @@ function onObjectSearchStart(object, playerColor)
end
end
-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag
-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the
-- Event hook for any object search. When chaos tokens are manipulated while the chaos bag
-- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the
-- chaos bag during search operations to avoid this.
function onObjectSearchEnd(object, playerColor)
local chaosBag = findChaosBag()
if object == chaosBag then
bagSearchers[playerColor] = nil
end
Player[playerColor].clearSelectedObjects()
end
-- Pass object enter container events to the PlayArea to clear vector lines from dragged cards.
@ -457,8 +458,8 @@ function returnAndRedraw(_, tokenGUID)
return chaosTokens[indexOfReturnedToken]
end
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
-- contents of the bag should check this method before doing so.
-- This method will broadcast a message to all players if the bag is being searched.
---@return boolean: True if the bag is manipulated, false if it should be blocked.
@ -558,9 +559,9 @@ end
-- token spawning
---------------------------------------------------------
-- DEPRECATED. Use TokenManager instead.
-- DEPRECATED. Use TokenManager instead.
-- Spawns a single token.
---@param params table Array with arguments to the method. 1 = position, 2 = type, 3 = rotation
---@param params table Array with arguments to the method. 1 = position, 2 = type, 3 = rotation
function spawnToken(params)
return tokenManager.spawnToken(params[1], params[2], params[3])
end