From 875b2bc86328ad8167cfceff26976021a29deba4 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 7 Jul 2024 23:50:06 +0200 Subject: [PATCH] updated chaosbagapi --- src/chaosbag/ChaosBagApi.ttslua | 12 ++++++------ src/core/Global.ttslua | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/chaosbag/ChaosBagApi.ttslua b/src/chaosbag/ChaosBagApi.ttslua index 5882d5bb..6d76ba29 100644 --- a/src/chaosbag/ChaosBagApi.ttslua +++ b/src/chaosbag/ChaosBagApi.ttslua @@ -4,7 +4,7 @@ do -- respawns the chaos bag with a new state of tokens ---@param tokenList table List of chaos token ids ChaosBagApi.setChaosBagState = function(tokenList) - return Global.call("setChaosBagState", tokenList) + Global.call("setChaosBagState", tokenList) end -- returns a Table List of chaos token ids in the current chaos bag @@ -31,30 +31,30 @@ do -- returns all sealed tokens on cards to the chaos bag ---@param playerColor string Color of the player to show the broadcast to ChaosBagApi.releaseAllSealedTokens = function(playerColor) - return Global.call("releaseAllSealedTokens", playerColor) + Global.call("releaseAllSealedTokens", playerColor) end -- returns all drawn tokens to the chaos bag ChaosBagApi.returnChaosTokens = function() - return Global.call("returnChaosTokens") + Global.call("returnChaosTokens") end -- removes the specified chaos token from the chaos bag ---@param id string ID of the chaos token ChaosBagApi.removeChaosToken = function(id) - return Global.call("removeChaosToken", id) + Global.call("removeChaosToken", id) end -- returns a chaos token to the bag and calls all relevant functions ---@param token tts__Object Chaos token to return ChaosBagApi.returnChaosTokenToBag = function(token) - return Global.call("returnChaosTokenToBag", token) + Global.call("returnChaosTokenToBag", token) end -- spawns the specified chaos token and puts it into the chaos bag ---@param id string ID of the chaos token ChaosBagApi.spawnChaosToken = function(id) - return Global.call("spawnChaosToken", id) + Global.call("spawnChaosToken", id) end -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 049dee56..1916b72c 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -445,6 +445,9 @@ function returnAndRedraw(_, tokenGUID) end redrawData = {} + + -- return a reference to the freshly drawn token + return chaosTokens[indexOfReturnedToken] end -- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens