From d62456258a8352bffc6b8b259e29d55dabe3acb8 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Wed, 31 Jul 2024 06:38:20 -0500 Subject: [PATCH] added save state --- src/playercards/CardsThatSealTokens.ttslua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index ec327c6a..2c87487a 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -183,9 +183,12 @@ function readBag() end end +-- save state when going into bags / decks +function onDestroy() self.script_state = onSave() end + function resetSealedTokens() - log("Resetting") sealedTokens = {} + self.script_state = onSave() end -- native event from TTS - used to update the context menu for cards like "Unrelenting" @@ -245,8 +248,6 @@ function releaseOneToken(playerColor) else printToColor("Releasing token", playerColor) putTokenAway(table.remove(sealedTokens)) - log("Removed one") - log(#sealedTokens) end end @@ -278,9 +279,8 @@ function releaseAllTokens(playerColor) for _, guid in ipairs(sealedTokens) do putTokenAway(guid) end - log("Removed all") - log(#sealedTokens) sealedTokens = {} + self.script_state = onSave() end end