added save state
This commit is contained in:
parent
34de9c1d01
commit
d62456258a
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user