Merge pull request #141 from Pokachi/main
added a scenario name splash on placing down scenarios and setting to toggle it
This commit is contained in:
commit
3797b3ef2d
@ -1 +1 @@
|
||||
{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":[],"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true}}
|
||||
{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":[],"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true,"showTitleSplash":true}}
|
||||
|
@ -34,6 +34,7 @@ local chaosTokens = {}
|
||||
local chaosTokensLastMat = nil
|
||||
local IS_RESHUFFLING = false
|
||||
local bagSearchers = {}
|
||||
local hideTitleSplashWaitFunctionId = nil
|
||||
local playmatAPI = require("playermat/PlaymatApi")
|
||||
|
||||
---------------------------------------------------------
|
||||
@ -818,6 +819,10 @@ function applyOptionPanelChange(id, state)
|
||||
-- update master clue counter
|
||||
getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state)
|
||||
|
||||
-- option: Show Title on placing scenarios
|
||||
elseif id == "showTitleSplash" then
|
||||
optionPanel[id] = state
|
||||
|
||||
-- option: Show token arranger
|
||||
elseif id == "showTokenArranger" then
|
||||
-- delete previously pulled out tokens
|
||||
@ -931,7 +936,7 @@ function onClick_defaultSettings()
|
||||
for id, _ in pairs(optionPanel) do
|
||||
local state = false
|
||||
-- override for settings that are enabled by default
|
||||
if id == "useSnapTags" then
|
||||
if id == "useSnapTags" or id == "showTitleSplash" then
|
||||
state = true
|
||||
end
|
||||
applyOptionPanelChange(id, state)
|
||||
@ -942,6 +947,7 @@ function onClick_defaultSettings()
|
||||
useSnapTags = true,
|
||||
showDrawButton = false,
|
||||
useClueClickers = false,
|
||||
showTitleSplash = true,
|
||||
showTokenArranger = false,
|
||||
showCleanUpHelper = false,
|
||||
showHandHelper = {},
|
||||
@ -952,3 +958,25 @@ function onClick_defaultSettings()
|
||||
-- update UI
|
||||
updateOptionPanelState()
|
||||
end
|
||||
|
||||
-- splash scenario title on setup
|
||||
function titleSplash(scenarioName)
|
||||
if optionPanel['showTitleSplash'] then
|
||||
|
||||
-- if there's any ongoing title being displayed, hide it and cancel the waiting function
|
||||
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', scenarioName)
|
||||
UI.show('title_splash')
|
||||
hideTitleSplashWaitFunctionId = Wait.time(function()
|
||||
UI.hide('title_splash')
|
||||
hideTitleSplashWaitFunctionId = nil
|
||||
end, 4)
|
||||
end
|
||||
end
|
||||
|
@ -55,6 +55,7 @@ function resetTokensIfInDeckZone(container, object)
|
||||
end
|
||||
|
||||
function fireScenarioChangedEvent()
|
||||
Global.call('titleSplash', currentScenario)
|
||||
playArea.onScenarioChanged(currentScenario)
|
||||
end
|
||||
|
||||
|
@ -104,4 +104,17 @@
|
||||
</Panel>
|
||||
</VerticalLayout>
|
||||
|
||||
<!-- Title Splash when starting a scenario -->
|
||||
<Text id="title_splash"
|
||||
fontSize="150"
|
||||
font="font_teutonic-arkham"
|
||||
outline="black"
|
||||
outlineSize="3 -3"
|
||||
showAnimation="FadeIn"
|
||||
hideAnimation="FadeOut"
|
||||
active="false"
|
||||
animationDuration="2"
|
||||
horizontalOverflow="Wrap">
|
||||
</Text>
|
||||
|
||||
<Include src="OptionPanel.xml"/>
|
||||
|
@ -142,6 +142,20 @@
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option: splash scenario name on setup -->
|
||||
<Row class="option-text">
|
||||
<Cell class="option-text">
|
||||
<VerticalLayout class="text-column">
|
||||
<Text class="option-header">Show Scenario Title on Setup</Text>
|
||||
<Text class="description">Fade in the name of the scenario for 2 seconds when placing down a scenario.</Text>
|
||||
</VerticalLayout>
|
||||
</Cell>
|
||||
<Cell class="option-button">
|
||||
<Toggle id="showTitleSplash"
|
||||
onValueChanged="onClick_toggleOption(showTitleSplash)"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Group: fan-made accessories -->
|
||||
<Row class="group-header">
|
||||
<Cell class="group-header">
|
||||
|
Loading…
Reference in New Issue
Block a user