Merge pull request #183 from argonui/title-gradient

Enhancements and tweaks for the scenario title splash
This commit is contained in:
Chr1Z 2023-01-11 23:46:19 +01:00 committed by GitHub
commit 560ddf7b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 11 deletions

View File

@ -198,5 +198,10 @@
"Name": "Inv-Jacqueline",
"Type": 0,
"URL": "https://i.imgur.com/AFuB9II.png"
},
{
"Name": "TitleGradient",
"Type": 0,
"URL": "https://i.imgur.com/Mdjm349.png"
}
]

View File

@ -875,7 +875,7 @@ function applyOptionPanelChange(id, state)
-- option: Show CYOA campaign guides
elseif id == "showCYOA" then
optionPanel[id] = spawnOrRemoveHelper(state, "CYOA Campaign Guides", {65, 1.6, -11})
-- option: Show custom playmat images
elseif id == "showCustomPlaymatImages" then
optionPanel[id] = spawnOrRemoveHelper(state, "Custom Playmat Images", {67.5, 1.6, 37})
@ -1018,7 +1018,7 @@ function titleSplash(scenarioName)
-- 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.setValue('title_splash_text', scenarioName)
UI.show('title_splash')
hideTitleSplashWaitFunctionId = Wait.time(function()
UI.hide('title_splash')

View File

@ -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

View File

@ -98,16 +98,28 @@
</VerticalLayout>
<!-- Title Splash when starting a scenario -->
<Text id="title_splash"
fontSize="150"
font="font_teutonic-arkham"
outline="black"
outlineSize="3 -3"
<Panel
id="title_splash"
height="220"
position="0 250 0"
showAnimation="FadeIn"
hideAnimation="FadeOut"
active="false"
animationDuration="2"
horizontalOverflow="Wrap">
</Text>
animationDuration="2">
<Image
id="title_gradient"
height="220"
image="TitleGradient" />
<Text id="title_splash_text"
width="95%"
height="180"
resizeTextForBestFit="true"
resizeTextMinSize="100"
resizeTextMaxSize="150"
font="font_teutonic-arkham"
outline="black"
outlineSize="3 -3"
horizontalOverflow="Overflow">
</Text>
</Panel>
<Include src="OptionPanel.xml"/>