From bcc6dc5b8d783ca31209d77107b34e2f45994917 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Wed, 11 Jan 2023 14:37:30 -0800 Subject: [PATCH] Tweak title splash - Move position up - Add common COLLISION_ENABLED handling to prevent splash from showing when reloading a save with the scenario card on the table --- src/core/MythosArea.ttslua | 6 ++++++ xml/Global.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index 79a02fa4..5877a4fa 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -11,12 +11,15 @@ local ENCOUNTER_DISCARD_AREA = { } local currentScenario +-- we use this to turn off collision handling until onLoad() is complete +local COLLISION_ENABLED = false function onLoad(saveState) if saveState ~= nil then local loadedState = JSON.decode(saveState) or { } currentScenario = loadedState.currentScenario end + COLLISION_ENABLED = true end function onSave() @@ -27,6 +30,9 @@ end -- TTS event handler. Handles scenario name event triggering and encounter card token resets. function onCollisionEnter(collisionInfo) + if not COLLISION_ENABLED then + return + end local object = collisionInfo.collision_object if object.getName() == "Scenario" then if currentScenario ~= object.getDescription() then diff --git a/xml/Global.xml b/xml/Global.xml index 83f1fcdb..128083f7 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -101,6 +101,7 @@