destroys XML on hidden tokens

This commit is contained in:
dscarpac 2024-07-07 08:38:03 -05:00
parent 07fdfface2
commit 289f786eb2

View File

@ -221,9 +221,12 @@ function sealToken(name, playerColor)
if name == "Bless" or name == "Curse" then if name == "Bless" or name == "Curse" then
blessCurseManagerApi.sealedToken(name, guid) blessCurseManagerApi.sealedToken(name, guid)
end end
if MAX_SEALED > 1 then --destroy XML on just covered token
updateStackSize(token, name) if #sealedTokens > 1 then
local coveredToken = getObjectFromGUID(sealedTokens[#sealedTokens - 1])
coveredToken.UI.setXml("")
end end
updateStackSize()
end end
}) })
return return
@ -313,6 +316,7 @@ function putTokenAway(guid)
if name == "Bless" or name == "Curse" then if name == "Bless" or name == "Curse" then
blessCurseManagerApi.releasedToken(name, guid) blessCurseManagerApi.releasedToken(name, guid)
end end
updateStackSize()
end end
-- returns the token to the pool (== removes it) -- returns the token to the pool (== removes it)
@ -325,6 +329,7 @@ function returnToken(guid)
if name == "Bless" or name == "Curse" then if name == "Bless" or name == "Curse" then
blessCurseManagerApi.returnedToken(name, guid) blessCurseManagerApi.returnedToken(name, guid)
end end
updateStackSize()
end end
-- resolves sealed token as if it came from the chaos bag -- resolves sealed token as if it came from the chaos bag
@ -338,10 +343,16 @@ function resolveSealed()
local guidToBeResolved = table.remove(sealedTokens) local guidToBeResolved = table.remove(sealedTokens)
local token = getObjectFromGUID(guidToBeResolved) local token = getObjectFromGUID(guidToBeResolved)
token.UI.setXml("") token.UI.setXml("")
updateStackSize()
chaosBagApi.drawChaosToken(mat, true, _, guidToBeResolved) chaosBagApi.drawChaosToken(mat, true, _, guidToBeResolved)
end end
function updateStackSize(token, name) function updateStackSize()
if MAX_SEALED == 1 then return end
-- get topmost sealed token
local token = getObjectFromGUID(sealedTokens[#sealedTokens])
local name = token.getName()
token.UI.setXmlTable({ token.UI.setXmlTable({
{ {
tag = "Panel", tag = "Panel",