diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 585ac13a..c6e3321c 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -34,6 +34,7 @@ local chaosTokens = {} local chaosTokensLastMat = nil local IS_RESHUFFLING = false local bagSearchers = {} +local hideTitleSplashWaitFunctionId = nil local playmatAPI = require("playermat/PlaymatApi") --------------------------------------------------------- @@ -959,24 +960,23 @@ function onClick_defaultSettings() end -- splash scenario title on setup -titleSplashId = nil -function titleSplash(params) - if self.UI.getAttribute('showTitleSplash', "isOn") == "True" then +function titleSplash(scenarioName) + if optionPanel['showTitleSplash'] then -- if there's any ongoing title being displayed, hide it and cancel the waiting function - if titleSplashId then - Wait.stop(titleSplashId) - titleSplashId = nil + if hideTitleSplashWaitFunctionId then + Wait.stop(hideTitleSplashWaitFunctionId) + hideTitleSplashWaitFunctionId = nil UI.setAttribute('title_splash', 'active', false) end -- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen) -- wait timer to hide the scenario name - UI.setValue('title_splash', params.scenarioName) + UI.setValue('title_splash', scenarioName) UI.show('title_splash') - titleSplashId = Wait.time(function() + hideTitleSplashWaitFunctionId = Wait.time(function() UI.hide('title_splash') - titleSplashId = nil + hideTitleSplashWaitFunctionId = nil end, 4) end -end \ No newline at end of file +end diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index 8320bee3..94933d64 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -55,7 +55,7 @@ function resetTokensIfInDeckZone(container, object) end function fireScenarioChangedEvent() - Global.call('titleSplash', {scenarioName = currentScenario}) + Global.call('titleSplash', currentScenario) playArea.onScenarioChanged(currentScenario) end diff --git a/xml/Global.xml b/xml/Global.xml index e11d79a5..dc15bced 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -106,7 +106,6 @@