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:
parent
7a2d025f37
commit
bcc6dc5b8d
@ -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
|
||||
|
@ -101,6 +101,7 @@
|
||||
<Panel
|
||||
id="title_splash"
|
||||
height="220"
|
||||
position="0 250 0"
|
||||
showAnimation="FadeIn"
|
||||
hideAnimation="FadeOut"
|
||||
active="false"
|
||||
|
Loading…
Reference in New Issue
Block a user