Merge pull request #522 from argonui/playarea

QoL update for play area
This commit is contained in:
Entrox-Licher 2024-01-03 11:15:57 -05:00 committed by GitHub
commit 7b1916e35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -245,6 +245,9 @@ function tidyPlayareaCoroutine()
local trash = guidReferenceApi.getObjectByOwnerAndType("Mythos", "Trash")
local playAreaZone = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaZone")
-- reset the playarea image by not providing an image
playAreaApi.updateSurface()
if playAreaZone == nil then
printToAll("Scripting zone for main play area could not be found!", "Red")
elseif trash == nil then

View File

@ -20,7 +20,6 @@ ENCOUNTER_DECK_DISCARD_POSITION = { -3.85, 1, 10.38 }
-- GUIDs that will not be interactable (e.g. parts of the table)
local NOT_INTERACTABLE = {
"6161b4", -- Decoration-Map
"721ba2", -- PlayArea
"9f334f", -- MythosArea
"463022", -- Panel behind tentacle stand
"f182ee", -- InvestigatorCount

View File

@ -61,6 +61,7 @@ function onSave()
end
function onLoad(savedData)
self.interactable = false -- this needs to be here since the playarea will be reloaded when the image changes
local loadedData = JSON.decode(savedData) or {}
locations = loadedData.trackedLocations or {}
currentScenario = loadedData.currentScenario
@ -84,10 +85,10 @@ function updateSurface(newURL)
if newURL ~= "" and newURL ~= nil and newURL ~= DEFAULT_URL then
customInfo.image = newURL
broadcastToAll("New Playmat Image Applied", { 0.2, 0.9, 0.2 })
broadcastToAll("New Playarea Image Applied", { 0.2, 0.9, 0.2 })
else
customInfo.image = DEFAULT_URL
broadcastToAll("Default Playmat Image Applied", { 0.2, 0.9, 0.2 })
broadcastToAll("Default Playarea Image Applied", { 0.2, 0.9, 0.2 })
end
self.setCustomObject(customInfo)