Addressed more PR suggestions, removing extraneous scripting zone and adding more information and comments on tool

This commit is contained in:
Entrox-Licher 2023-06-18 01:45:03 -04:00
parent 838c0be0fc
commit 7a79bc8fac
4 changed files with 17 additions and 56 deletions

View File

@ -202,8 +202,7 @@
"NavigationOverlayHandler.797ede",
"TheColourOutofOz.be7d21",
"Bloodborne-CityoftheUnseen0175.81651b",
"CampaignImporterExporter.334ee3",
"ScriptingTrigger.ef3b5f"
"CampaignImporterExporter.334ee3"
],
"PlayArea": 1,
"PlayerCounts": [

View File

@ -22,7 +22,7 @@
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/254843371583173230/BECDC34EB4D2C8C5F9F9933C97085F82A2F21AE3/",
"WidthScale": 0
},
"Description": "",
"Description": "Saves the state of the table to enable loading the campaign into a new save and keep all current progress.\n\nThis tool will track which campaign you're playing, the entire contents of your campaign log, the contents of your chaos bag, update your health/sanity according to trauma, your ArkhamDB deck IDs, the number of investigators, the page of your campaign guide, and any options you have selected in the options panel.",
"DragSelectable": true,
"GMNotes": "",
"GUID": "334ee3",

View File

@ -1,46 +0,0 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"a": 0.5098,
"b": 1,
"g": 1,
"r": 1
},
"Description": "",
"DragSelectable": true,
"GMNotes": "",
"GUID": "ef3b5f",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "",
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "ScriptingTrigger",
"Nickname": "",
"Snap": true,
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -21.959,
"posY": 1.726,
"posZ": 55.196,
"rotX": 0,
"rotY": 90,
"rotZ": 0,
"scaleX": 13.76,
"scaleY": 5.1,
"scaleZ": 11.32
},
"Value": 0,
"XmlUI": ""
}

View File

@ -65,6 +65,7 @@ function onLoad(save_state)
click_function = "findCampaignFromToken",
function_owner = self,
label = "Import",
tooltip = "Create a campaign save token!\n\n(Ensure all chaos tokens have been unsealed!)",
position = {x=-1, y=0.2, z=0},
font_size = 400,
width = 1400,
@ -75,6 +76,7 @@ function onLoad(save_state)
click_function = "createCampaignToken",
function_owner = self,
label = "Export",
tooltip = "Load in a campaign save from a token!",
position = {x=1, y=0.2, z=0},
font_size = 400,
width = 1400,
@ -83,16 +85,18 @@ function onLoad(save_state)
})
end
-- The main import functions. Due to timing concerns, has to be split up into several separate methods to allow for Wait conditions
-- Identifies import token, determines campaign box and downloads it (if needed)
function findCampaignFromToken(_, _, _)
local coin = nil
for _, obj in ipairs(tokenZone.getObjects()) do
if obj.hasTag("ImporterToken") then
coin = obj
end
end
if coin == nil then
local coinObjects = getObjectsWithTag("ImporterToken")
if #coinObjects == 0 then
broadcastToAll("Could not find importer token", Color.Red)
elseif #coinObjects > 1 then
broadcastToAll("More than 1 importer token found. Please delete all but 1 importer token", Color.Yellow)
else
coin = coinObjects[1]
local importData = JSON.decode(coin.getGMNotes())
campaignBoxGUID = importData[1]
local campaignBox = getObjectFromGUID(campaignBoxGUID)
@ -121,6 +125,7 @@ function findCampaignFromToken(_, _, _)
end
end
-- After box has been downloaded, places content on table
function placeCampaignFromToken(importData)
getObjectFromGUID(campaignBoxGUID).call("buttonClick_place")
Wait.condition(
@ -131,6 +136,7 @@ function placeCampaignFromToken(importData)
)
end
-- After content is placed on table, conducts all the other import operations
function createCampaignFromToken(importData)
findCampaignLog().destruct()
--create campaign log
@ -167,6 +173,8 @@ function createCampaignFromToken(importData)
broadcastToAll("Campaign successfully imported!", Color.Green)
end
-- Creates a campaign token with save data encoded into GM Notes based on the current state of the table
function createCampaignToken(_, _, _)
local campaignBoxGUID = ""
-- find active campaign
@ -215,7 +223,7 @@ function createCampaignToken(_, _, _)
Global.getTable("optionPanel")
}
campaignTokenData.GMNotes = JSON.encode(campaignData)
campaignTokenData.Nickname = os.date(" Save: %b %d") .. getObjectFromGUID(campaignBoxGUID).getName()
campaignTokenData.Nickname = os.date("%b %d ") .. getObjectFromGUID(campaignBoxGUID).getName() .. " Save"
spawnObjectData({
data = campaignTokenData,
position = {-21.25, 1.68, 55.59}