merged changes into updateSave function
This commit is contained in:
parent
d62456258a
commit
ec315a2b3a
@ -104,7 +104,9 @@ local tokenColor = {
|
||||
[""] = "#77674DE6"
|
||||
}
|
||||
|
||||
function onSave() return JSON.encode(sealedTokens) end
|
||||
function updateSave()
|
||||
self.script_state = JSON.encode(sealedTokens)
|
||||
end
|
||||
|
||||
function onLoad(savedData)
|
||||
sealedTokens = JSON.decode(savedData) or {}
|
||||
@ -184,11 +186,11 @@ function readBag()
|
||||
end
|
||||
|
||||
-- save state when going into bags / decks
|
||||
function onDestroy() self.script_state = onSave() end
|
||||
function onDestroy() updateSave() end
|
||||
|
||||
function resetSealedTokens()
|
||||
sealedTokens = {}
|
||||
self.script_state = onSave()
|
||||
updateSave()
|
||||
end
|
||||
|
||||
-- native event from TTS - used to update the context menu for cards like "Unrelenting"
|
||||
@ -280,7 +282,7 @@ function releaseAllTokens(playerColor)
|
||||
putTokenAway(guid)
|
||||
end
|
||||
sealedTokens = {}
|
||||
self.script_state = onSave()
|
||||
updateSave()
|
||||
end
|
||||
end
|
||||
|
||||
@ -340,6 +342,7 @@ function resolveSealed()
|
||||
end
|
||||
|
||||
function updateStackSize()
|
||||
updateSave()
|
||||
if MAX_SEALED == 1 then return end
|
||||
if #sealedTokens == 0 then return end
|
||||
-- get topmost sealed token
|
||||
|
Loading…
Reference in New Issue
Block a user