resolving review comments

This commit is contained in:
Chr1Z93 2023-04-08 20:04:30 +02:00
parent 6f795dfc82
commit 2a1033c5c4
2 changed files with 7 additions and 6 deletions

View File

@ -134,8 +134,8 @@ function doRemove(color)
broadcastToColor("Removed " .. count.Bless .. " Bless and " ..
count.Curse .. " Curse tokens from the chaos bag.", color, "White")
broadcastToColor("Removed " .. removeType("Bless") .. " Bless and " ..
removeType("Curse") .. " Curse tokens from play.", color, "White")
broadcastToColor("Removed " .. removeTakenTokens("Bless") .. " Bless and " ..
removeTakenTokens("Curse") .. " Curse tokens from play.", color, "White")
doReset(color)
end
@ -150,7 +150,7 @@ function doReset(color)
end
-- removing tokens that were 'taken'
function removeType(type)
function removeTakenTokens(type)
local count = 0
for _, guid in ipairs(tokensTaken[type]) do
local token = getObjectFromGUID(guid)
@ -268,10 +268,10 @@ function releasedToken(param)
end
if not updating then
updating = true
Wait.time(function()
Wait.frames(function()
broadcastCount(param.type)
updating = false
end, 0.1)
end, 1)
end
end

View File

@ -69,7 +69,7 @@ local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
local tokenArrangerApi = require("accessories/TokenArrangerApi")
local sealedTokens = {}
local ID_URL_MAP = {}
tokensInBag = {}
local tokensInBag = {}
function onSave() return JSON.encode(sealedTokens) end
@ -189,6 +189,7 @@ function releaseMultipleTokens(playerColor)
printToColor("Not enough " .. name .. " tokens sealed.", playerColor)
end
end
-- releases all sealed tokens
function releaseAllTokens(playerColor)
if not Global.call("canTouchChaosTokens") then return end