Addressing PR fixes
This commit is contained in:
parent
1bc78bd2a1
commit
01a292f10a
@ -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
|
||||
@ -206,8 +206,7 @@ function createCampaignToken(_, playerColor, _)
|
||||
table.insert(traumaValues, val)
|
||||
end
|
||||
else
|
||||
printToAll("Trauma values could not be found in campaign log!", "Yellow")
|
||||
return
|
||||
printToAll("Trauma values could not be found in campaign log!", "Yellow")
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user