From 5caeb47c822afa04807672e81855d1f3571ed14c Mon Sep 17 00:00:00 2001 From: Buhallin Date: Tue, 10 Jan 2023 18:05:19 -0800 Subject: [PATCH] Enhancements and tweaks for the scenario title splash - Add a background gradient - Add a wrapping panel to hold both text and gradient - Add font resizing in case of very long scenario names. None currently overflow, but this should ensure they stay on one line if we get a longer one --- modsettings/CustomUIAssets.json | 5 +++++ src/core/Global.ttslua | 7 +++++-- xml/Global.xml | 29 ++++++++++++++++++++--------- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/modsettings/CustomUIAssets.json b/modsettings/CustomUIAssets.json index 4b490189..89c15583 100644 --- a/modsettings/CustomUIAssets.json +++ b/modsettings/CustomUIAssets.json @@ -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/bY6nZbu.png" } ] diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 6ede2b21..b8e5a175 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -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}) @@ -1014,14 +1014,17 @@ function titleSplash(scenarioName) Wait.stop(hideTitleSplashWaitFunctionId) hideTitleSplashWaitFunctionId = nil UI.setAttribute('title_splash', 'active', false) + -- UI.setAttribute('title_gradient', '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.setValue('title_splash_text', scenarioName) UI.show('title_splash') + -- UI.show('title_gradient') hideTitleSplashWaitFunctionId = Wait.time(function() UI.hide('title_splash') + -- UI.hide('title_gradient') hideTitleSplashWaitFunctionId = nil end, 4) end diff --git a/xml/Global.xml b/xml/Global.xml index 8e9dc4b1..36a1a7f4 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -98,16 +98,27 @@ - - - + animationDuration="2"> + + + +