Fixed an issue with trauma and deck IDs importing

This commit is contained in:
Entrox-Licher 2023-07-01 18:42:27 -04:00
parent ec28088945
commit 004abbcfb6

View File

@ -143,11 +143,11 @@ function createCampaignFromToken(importData)
--create chaos bag
chaosBagApi.setChaosBagState(importData["bag"])
--populate trauma values
if importData[4] then
if importData["trauma"] then
updateCounters(importData["trauma"])
end
--populate ArkhamDB deck IDs
if importData[5] then
if importData["decks"] then
deckImporterApi.setUiState(importData["decks"])
end
--set investigator count
@ -194,9 +194,10 @@ function createCampaignToken(_, _, _)
broadcastToAll("Campaign log not found!", Color.Red)
return
end
local traumaValues = nil
local counterData = campaignLog.getVar("ref_buttonData")
if counterData ~= nil then
local traumaValues = {}
traumaValues = {}
printToAll("Trauma values found in campaign log!", "Green")
for i = 1, 10, 3 do
traumaValues[1 + (i - 1) / 3] = counterData.counter[i].value
@ -212,7 +213,6 @@ function createCampaignToken(_, _, _)
return
end
local campaignGuidePage = campaignGuide.Book.getPage()
local campaignData = {
box = campaignBoxGUID,
log = campaignLog.getData(),