diff --git a/src/accessories/CampaignImporterExporter.ttslua b/src/accessories/CampaignImporterExporter.ttslua index 97dc33b2..fe7834a7 100644 --- a/src/accessories/CampaignImporterExporter.ttslua +++ b/src/accessories/CampaignImporterExporter.ttslua @@ -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 diff --git a/src/core/tour/TourApi.ttslua b/src/core/tour/TourApi.ttslua deleted file mode 100644 index 1e51b874..00000000 --- a/src/core/tour/TourApi.ttslua +++ /dev/null @@ -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 \ No newline at end of file