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
This commit is contained in:
Buhallin 2023-01-11 14:37:30 -08:00
parent 7a2d025f37
commit bcc6dc5b8d
No known key found for this signature in database
GPG Key ID: DB3C362823852294
2 changed files with 7 additions and 0 deletions

View File

@ -11,12 +11,15 @@ local ENCOUNTER_DISCARD_AREA = {
} }
local currentScenario local currentScenario
-- we use this to turn off collision handling until onLoad() is complete
local COLLISION_ENABLED = false
function onLoad(saveState) function onLoad(saveState)
if saveState ~= nil then if saveState ~= nil then
local loadedState = JSON.decode(saveState) or { } local loadedState = JSON.decode(saveState) or { }
currentScenario = loadedState.currentScenario currentScenario = loadedState.currentScenario
end end
COLLISION_ENABLED = true
end end
function onSave() function onSave()
@ -27,6 +30,9 @@ end
-- TTS event handler. Handles scenario name event triggering and encounter card token resets. -- TTS event handler. Handles scenario name event triggering and encounter card token resets.
function onCollisionEnter(collisionInfo) function onCollisionEnter(collisionInfo)
if not COLLISION_ENABLED then
return
end
local object = collisionInfo.collision_object local object = collisionInfo.collision_object
if object.getName() == "Scenario" then if object.getName() == "Scenario" then
if currentScenario ~= object.getDescription() then if currentScenario ~= object.getDescription() then

View File

@ -101,6 +101,7 @@
<Panel <Panel
id="title_splash" id="title_splash"
height="220" height="220"
position="0 250 0"
showAnimation="FadeIn" showAnimation="FadeIn"
hideAnimation="FadeOut" hideAnimation="FadeOut"
active="false" active="false"