Final PR Comments Addressed

For sure this time XD
This commit is contained in:
Entrox-Licher 2023-08-10 16:47:31 -04:00
parent 2e1ee1b2f8
commit 302ebfe11c
2 changed files with 13 additions and 18 deletions

View File

@ -51,7 +51,8 @@ local playAreaApi = require("core/PlayAreaApi")
local deckImporterApi = require("arkhamdb/DeckImporterApi")
local optionPanelApi = require("core/OptionPanelApi")
local blessCurseApi = require("chaosbag/BlessCurseManagerApi")
local tourApi = require("core/tour/TourApi")
local TOUR_GUID = "0e5aa8"
local campaignBoxGUID
@ -151,18 +152,23 @@ function createCampaignFromToken(importData)
--set investigator count
playAreaApi.setInvestigatorCount(importData["clueCount"])
--set campaign guide page
if findCampaignGuide() then
local guide = findCampaignGuide()
if guide then
Wait.condition(
-- Called after the condition function returns true
function()
--log("Campaign Guide import successful!")
log("Campaign Guide import successful!")
end,
-- Condition function that is called continiously until returs true or timeout is reached
function()
findCampaignGuide().Book.setPage(importData["guide"])
return findCampaignGuide().Book.getPage() == importData["guide"]
guide.Book.setPage(importData["guide"])
return guide.Book.getPage() == importData["guide"]
end,
-- Amount of time in seconds until the Wait times out
1,
-- Called if the Wait times out
function()
--log("Campaign Guide import failed!")
log("Campaign Guide import failed!")
end
)
end
@ -170,7 +176,7 @@ function createCampaignFromToken(importData)
function() optionPanelApi.loadSettings(importData["options"]) end,
0.5
)
tourApi.deleteTour()
getObjectFromGUID(TOUR_GUID).destruct()
playAreaApi.updateSurface(importData["playmat"])
broadcastToAll("Campaign successfully imported!", Color.Green)
end

View File

@ -1,11 +0,0 @@
do
local TourApi = {}
local TOUR_GUID = "0e5aa8"
TourApi.deleteTour = function()
getObjectFromGUID(TOUR_GUID).call("deleteStarter", nil, nil, nil)
end
return TourApi
end