Merge pull request #203 from argonui/customdatahelper-bugfix

Custom Data Helper referring bugfix
This commit is contained in:
Chr1Z 2023-01-27 20:58:25 +01:00 committed by GitHub
commit 279b68d5d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -160,7 +160,7 @@ end
-- main function -- main function
--------------------------------------------------------- ---------------------------------------------------------
function cleanUp() function cleanUp(_, color)
printToAll("------------------------------", "White") printToAll("------------------------------", "White")
printToAll("Clean up started!", "Orange") printToAll("Clean up started!", "Orange")
printToAll("Resetting counters...", "White") printToAll("Resetting counters...", "White")
@ -172,7 +172,7 @@ function cleanUp()
updateCounters(CLUE_CLICKER_GUIDS, 0, "Clue clickers") updateCounters(CLUE_CLICKER_GUIDS, 0, "Clue clickers")
resetSkillTrackers() resetSkillTrackers()
resetDoomCounter() resetDoomCounter()
removeBlessCurse() removeBlessCurse(color)
removeLines() removeLines()
discardHands() discardHands()
tokenSpawnTrackerApi.resetAll() tokenSpawnTrackerApi.resetAll()
@ -232,8 +232,8 @@ end
-- gets the GUID of a custom data helper (if present) and adds it to the ignore list -- gets the GUID of a custom data helper (if present) and adds it to the ignore list
function ignoreCustomDataHelper() function ignoreCustomDataHelper()
local playArea = getObjectFromGUID("721ba2") local playArea = getObjectFromGUID("721ba2")
local guid = playArea.getVar("customDataHelper") local customDataHelper = playArea.getVar("customDataHelper")
if guid then table.insert(IGNORE_GUIDS, guid) end if customDataHelper then table.insert(IGNORE_GUIDS, customDataHelper.getGUID()) end
end end
-- read values for trauma from campaign log if enabled -- read values for trauma from campaign log if enabled
@ -272,11 +272,11 @@ function getTrauma()
end end
-- get rid of bless/curse tokens via bless/curse manager -- get rid of bless/curse tokens via bless/curse manager
function removeBlessCurse() function removeBlessCurse(color)
local BlessCurseManager = getObjectFromGUID("5933fb") local BlessCurseManager = getObjectFromGUID("5933fb")
if BlessCurseManager ~= nil then if BlessCurseManager ~= nil then
BlessCurseManager.call("doRemove", "White") BlessCurseManager.call("doRemove", color)
else else
printToAll("Bless / Curse manager could not be found and thus bless/curse tokens were skipped.", "Yellow") printToAll("Bless / Curse manager could not be found and thus bless/curse tokens were skipped.", "Yellow")
end end

View File

@ -84,7 +84,10 @@ function updateSurface(newURL)
playArea.setCustomObject(customInfo) playArea.setCustomObject(customInfo)
-- get custom data helper and call the playarea with it after reloading -- get custom data helper and call the playarea with it after reloading
local guid = playArea.getVar("customDataHelper") local customDataHelper = playArea.getVar("customDataHelper")
local guid
if customDataHelper then guid = customDataHelper.getGUID() end
playArea = playArea.reload() playArea = playArea.reload()
if guid ~= nil then if guid ~= nil then