Addressing PR fixes

This commit is contained in:
Entrox-Licher 2024-01-09 13:42:00 -05:00
parent 1bc78bd2a1
commit 01a292f10a

View File

@ -52,7 +52,7 @@ function onLoad()
function_owner = self,
label = "Export",
tooltip = "Create a campaign save token!",
position = { x = -1, y = 0.2, z = 0 },
position = { x = -1, y = 0.21, z = 0 },
font_size = 400,
width = 1400,
height = 600,
@ -67,17 +67,17 @@ end
function onCollisionEnter(info)
local objectData = info.collision_object.getData()
if info.collision_object.hasTag("ImporterToken") then
findCampaignFromToken(info.collision_object)
importFromToken(info.collision_object)
end
end
-- Identifies import token, determines campaign box and downloads it (if needed)
function findCampaignFromToken(coin)
function importFromToken(coin)
broadcastToAll("Campaign Import Initiated")
local importData = JSON.decode(coin.getGMNotes())
coin.destruct()
campaignBoxGUID = importData["box"]
local campaignBoxGUID = importData["box"]
local campaignBox = getObjectFromGUID(campaignBoxGUID)
if campaignBox.type == "Generic" then
campaignBox.call("buttonClick_download")
@ -163,7 +163,7 @@ function createCampaignFromToken(importData)
end
-- restore PlayArea image
playAreaApi.updateSurface(importData["playmat"])
playAreaApi.updateSurface(importData["playarea"])
broadcastToAll("Campaign successfully imported!", Color.Green)
end
@ -207,7 +207,6 @@ function createCampaignToken(_, playerColor, _)
end
else
printToAll("Trauma values could not be found in campaign log!", "Yellow")
return
end
local campaignGuide = findUniqueObjectWithTag("CampaignGuide")
@ -227,7 +226,7 @@ function createCampaignToken(_, playerColor, _)
trauma = traumaValues,
decks = deckImporterApi.getUiState(),
clueCount = playAreaApi.getInvestigatorCount(),
playmat = playAreaApi.getSurface(),
playarea = playAreaApi.getSurface(),
options = optionPanelApi.getOptions(),
guide = campaignGuide.Book.getPage(),
additionalIndex = additionalIndex.getJSON()