added save state

This commit is contained in:
dscarpac 2024-07-31 06:38:20 -05:00
parent 34de9c1d01
commit d62456258a

View File

@ -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