added save state
This commit is contained in:
parent
34de9c1d01
commit
d62456258a
@ -183,9 +183,12 @@ function readBag()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- save state when going into bags / decks
|
||||||
|
function onDestroy() self.script_state = onSave() end
|
||||||
|
|
||||||
function resetSealedTokens()
|
function resetSealedTokens()
|
||||||
log("Resetting")
|
|
||||||
sealedTokens = {}
|
sealedTokens = {}
|
||||||
|
self.script_state = onSave()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- native event from TTS - used to update the context menu for cards like "Unrelenting"
|
-- native event from TTS - used to update the context menu for cards like "Unrelenting"
|
||||||
@ -245,8 +248,6 @@ function releaseOneToken(playerColor)
|
|||||||
else
|
else
|
||||||
printToColor("Releasing token", playerColor)
|
printToColor("Releasing token", playerColor)
|
||||||
putTokenAway(table.remove(sealedTokens))
|
putTokenAway(table.remove(sealedTokens))
|
||||||
log("Removed one")
|
|
||||||
log(#sealedTokens)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -278,9 +279,8 @@ function releaseAllTokens(playerColor)
|
|||||||
for _, guid in ipairs(sealedTokens) do
|
for _, guid in ipairs(sealedTokens) do
|
||||||
putTokenAway(guid)
|
putTokenAway(guid)
|
||||||
end
|
end
|
||||||
log("Removed all")
|
|
||||||
log(#sealedTokens)
|
|
||||||
sealedTokens = {}
|
sealedTokens = {}
|
||||||
|
self.script_state = onSave()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user