From 0f7bfa8bad8306d58bb23583fe6488eafa102b15 Mon Sep 17 00:00:00 2001 From: KamiliaBLow Date: Thu, 13 Jun 2024 14:06:48 +0900 Subject: [PATCH] 2. Other improvements - Deleted the file title_cards_dialog.html (it is not used) - Slightly improved UI for title card entry - Added ability to change font color in HEX (added to settings) - Added customization so you can speed up or slow down the text zoom - Need to manually add new localization strings for other languages --- lang/en.json | 17 ++++++- scripts/title_cards.js | 75 ++++++++++++++++++++++++++----- templates/title_cards.html | 56 ++++++++++++++++++++--- templates/title_cards_dialog.html | 7 --- 4 files changed, 130 insertions(+), 25 deletions(-) delete mode 100644 templates/title_cards_dialog.html diff --git a/lang/en.json b/lang/en.json index 5d7cd86..6132acf 100644 --- a/lang/en.json +++ b/lang/en.json @@ -216,20 +216,28 @@ "ffg-star-wars-enhancements.controls.title-cards.title": "Title Cards", "ffg-star-wars-enhancements.controls.title-cards.toptext-label": "Top Text", "ffg-star-wars-enhancements.controls.title-cards.bottomtext-label": "Bottom Text", + "ffg-star-wars-enhancements.controls.title-cards.toptext-label-2": "Top Text", + "ffg-star-wars-enhancements.controls.title-cards.bottomtext-label-2": "Bottom Text", "ffg-star-wars-enhancements.controls.title-cards.launch": "Launch Title Cards", "ffg-star-wars-enhancements.title-cards.ui.name": "Title Cards settings", "ffg-star-wars-enhancements.title-cards.ui.hint": "Configure Title Cards", "ffg-star-wars-enhancements.title-cards.ui.label": "Open Configuration", "ffg-star-wars-enhancements.title-cards.title-cards-logo": "Title Cards Logo", + "ffg-star-wars-enhancements.title-cards.title-cards-text-color": "Text Color Hex", + "ffg-star-wars-enhancements.title-cards.title-cards-text-color-hint": "Logo Color Hex", "ffg-star-wars-enhancements.title-cards.title-cards-logo-hint": "Logo to display first", "ffg-star-wars-enhancements.title-cards.title-cards-music": "Title Cards music", "ffg-star-wars-enhancements.title-cards.title-cards-music-hint": "Music to play. Default settings are synced to the Book of Boba Fett intro", "ffg-star-wars-enhancements.title-cards.title-cards-music-delay": "Music start delay", "ffg-star-wars-enhancements.title-cards.title-cards-music-delay-hint": "Delay in seconds until the music starts playing", - "ffg-star-wars-enhancements.title-cards.title-cards-top-font-size": "Top Text Size", + "ffg-star-wars-enhancements.title-cards.title-cards-top-font-size": "Episode Top Text Size", "ffg-star-wars-enhancements.title-cards.title-cards-top-font-size-hint": "Size of the top text in px", - "ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size": "Bottom Text Size", + "ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size": "Episode Bottom Text Size", "ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size-hint": "Size of the bottom text in px", + "ffg-star-wars-enhancements.title-cards.title-cards-top-font-size-2": "Logo Top Text Size", + "ffg-star-wars-enhancements.title-cards.title-cards-top-font-size-hint-2": "Size of the top text in px", + "ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size-2": "Logo Bottom Text Size", + "ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size-hint-2": "Size of the bottom text in px", "ffg-star-wars-enhancements.title-cards.title-cards-logo-delay": "Logo delay", "ffg-star-wars-enhancements.title-cards.title-cards-logo-delay-hint": "Time in seconds until the logo appears", "ffg-star-wars-enhancements.title-cards.title-cards-logo-duration": "Logo duration", @@ -237,6 +245,11 @@ "ffg-star-wars-enhancements.title-cards.title-cards-text-delay": "Text delay", "ffg-star-wars-enhancements.title-cards.title-cards-text-delay-hint": "Time in seconds until the text appears", "ffg-star-wars-enhancements.title-cards.title-cards-text-duration": "Text duration", + "ffg-star-wars-enhancements.title-cards.title-cards-text-duration-hint": "Time in seconds until the text appears", + "ffg-star-wars-enhancements.title-cards.title-cards-zoom-speed": "Zoom speed", + "ffg-star-wars-enhancements.title-cards.title-cards-zoom-speed-hint": "Zoom speed in second (bigger = slower, smaller = faster)", "ffg-star-wars-enhancements.title-cards.title-cards-close-delay": "Window close delay", + "ffg-star-wars-enhancements.title-cards.title-cards-logo-head": "Logo", + "ffg-star-wars-enhancements.title-cards.title-cards-episode-head": "Episode", "ffg-star-wars-enhancements.title-cards.title-cards-close-delay-hint": "Time in seconds since the text disappeared to close the window. If 0, will not close the window" } diff --git a/scripts/title_cards.js b/scripts/title_cards.js index 7b49e70..ad1f32b 100644 --- a/scripts/title_cards.js +++ b/scripts/title_cards.js @@ -5,15 +5,27 @@ export function title_cards_dialog() { title: game.i18n.localize("ffg-star-wars-enhancements.controls.title-cards.title"), content: `
+

${game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-logo-head")}

-

- - -

-

- - -

+

+ + +

+

+ + +

+
+

${game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-episode-head")}


+
+

+ + +

+

+ + +

`, buttons: { @@ -22,6 +34,8 @@ export function title_cards_dialog() { label: `${game.i18n.localize("ffg-star-wars-enhancements.controls.title-cards.launch")}`, callback: (html) => { let data = { + toptext2: html.find("input[name='toptext-2']").val(), + bottomtext2: html.find("input[name='bottomtext-2']").val(), toptext: html.find("input[name='toptext']").val(), bottomtext: html.find("input[name='bottomtext']").val(), }; @@ -72,6 +86,15 @@ export function init() { type: String, filePicker: "folder", default: "", + }); + game.settings.register("ffg-star-wars-enhancements", "title-cards-text-color", { + module: "ffg-star-wars-enhancements", + name: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-text-color"), + hint: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-text-color-hint"), + scope: "world", + config: false, + type: String, + default: "#ffd54e", }); game.settings.register("ffg-star-wars-enhancements", "title-cards-music", { module: "ffg-star-wars-enhancements", @@ -91,6 +114,24 @@ export function init() { config: false, type: Number, default: 0.0, + }); + game.settings.register("ffg-star-wars-enhancements", "title-cards-top-font-size-2", { + module: "ffg-star-wars-enhancements", + name: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-top-font-size-2"), + hint: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-top-font-size-hint-2"), + scope: "world", + config: false, + type: Number, + default: 50, + }); + game.settings.register("ffg-star-wars-enhancements", "title-cards-bottom-font-size-2", { + module: "ffg-star-wars-enhancements", + name: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size-2"), + hint: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-bottom-font-size-hint-2"), + scope: "world", + config: false, + type: Number, + default: 150, }); game.settings.register("ffg-star-wars-enhancements", "title-cards-top-font-size", { module: "ffg-star-wars-enhancements", @@ -99,7 +140,7 @@ export function init() { scope: "world", config: false, type: Number, - default: 150, + default: 30, }); game.settings.register("ffg-star-wars-enhancements", "title-cards-bottom-font-size", { module: "ffg-star-wars-enhancements", @@ -108,7 +149,7 @@ export function init() { scope: "world", config: false, type: Number, - default: 50, + default: 100, }); game.settings.register("ffg-star-wars-enhancements", "title-cards-logo-delay", { module: "ffg-star-wars-enhancements", @@ -145,6 +186,15 @@ export function init() { config: false, type: Number, default: 5, + }); + game.settings.register("ffg-star-wars-enhancements", "title-cards-zoom-speed", { + module: "ffg-star-wars-enhancements", + name: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-zoom-speed"), + hint: game.i18n.localize("ffg-star-wars-enhancements.title-cards.title-cards-zoom-speed-hint"), + scope: "world", + config: false, + type: Number, + default: 35, }); game.settings.register("ffg-star-wars-enhancements", "title-cards-close-delay", { module: "ffg-star-wars-enhancements", @@ -240,12 +290,16 @@ class TitleCardsApplication extends Application { */ getData() { let data = this.data; + data.textColor = game.settings.get("ffg-star-wars-enhancements", "title-cards-text-color"); data.topSize = game.settings.get("ffg-star-wars-enhancements", "title-cards-top-font-size"); data.bottomSize = game.settings.get("ffg-star-wars-enhancements", "title-cards-bottom-font-size"); + data.topSize2 = game.settings.get("ffg-star-wars-enhancements", "title-cards-top-font-size-2"); + data.bottomSize2 = game.settings.get("ffg-star-wars-enhancements", "title-cards-bottom-font-size-2"); data.logoDelay = game.settings.get("ffg-star-wars-enhancements", "title-cards-logo-delay"); data.logoDuration = game.settings.get("ffg-star-wars-enhancements", "title-cards-logo-duration"); data.textDelay = game.settings.get("ffg-star-wars-enhancements", "title-cards-text-delay"); data.textDuration = game.settings.get("ffg-star-wars-enhancements", "title-cards-text-duration"); + data.zoomSpeed = game.settings.get("ffg-star-wars-enhancements", "title-cards-zoom-speed"); return data; } @@ -425,3 +479,4 @@ class title_cards_UISettings extends FormApplication { } } } + diff --git a/templates/title_cards.html b/templates/title_cards.html index 5d01627..58411a5 100644 --- a/templates/title_cards.html +++ b/templates/title_cards.html @@ -1,6 +1,15 @@
-