From bf1f956f2b71de6570bc883ec94fa9a39f6b53d5 Mon Sep 17 00:00:00 2001 From: CPTN Cosmo Date: Sat, 24 Jan 2026 15:17:37 +0100 Subject: [PATCH 1/2] Implement a setting to hide party actors in the carousel, update rendering logic, and bump the module version. --- languages/de.json | 6 +++++- languages/en.json | 6 +++++- module.json | 4 ++-- scripts/module.js | 46 +++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/languages/de.json b/languages/de.json index 15dc5b6..570a5c1 100644 --- a/languages/de.json +++ b/languages/de.json @@ -46,7 +46,11 @@ "CarouselEffect": "Übergangseffekt", "CarouselEffectHint": "Animationseffekt beim Wechseln der Karten.", "CarouselGMMode": "GM Karussell-Verhalten", - "CarouselGMModeHint": "Wie der GM im Karussell behandelt werden soll." + "CarouselGMModeHint": "Wie der GM im Karussell dargestellt werden soll.", + "CarouselHidePlayers": "Spieler im Karussell verbergen", + "CarouselHidePlayersHint": "Wenn aktiviert, werden Spielercharaktere nicht im Karussell angezeigt.", + "CarouselHidePartyActor": "Party-Actor im Karussell verbergen", + "CarouselHidePartyActorHint": "Wenn aktiviert, werden Actors vom Typ 'Party' nicht im Karussell angezeigt." }, "OpenStream": "Stream-Ansicht öffnen", "ModeNumeric": "Numerisch (3/6)", diff --git a/languages/en.json b/languages/en.json index f0c4367..82fa18a 100644 --- a/languages/en.json +++ b/languages/en.json @@ -54,7 +54,11 @@ "CarouselEffect": "Transition Effect", "CarouselEffectHint": "Animation effect when switching cards.", "CarouselGMMode": "GM Carousel Behavior", - "CarouselGMModeHint": "How the GM should constitute in the carousel." + "CarouselGMModeHint": "How the GM should constitute in the carousel.", + "CarouselHidePlayers": "Hide Players in Carousel", + "CarouselHidePlayersHint": "If enabled, party actors (players) will not be shown in the carousel.", + "CarouselHidePartyActor": "Hide 'Party' Actor in Carousel", + "CarouselHidePartyActorHint": "If enabled, actors with the type 'Party' will not be shown in the carousel." }, "OpenStream": "Open Stream View", "ModeNumeric": "Numeric (3/6)", diff --git a/module.json b/module.json index 11b8a18..94e6031 100644 --- a/module.json +++ b/module.json @@ -1,7 +1,7 @@ { "id": "dh-stream-overlay", "title": "Daggerheart Stream Overlay", - "version": "2.0.0", + "version": "2.0.1", "compatibility": { "minimum": "13", "verified": "13" @@ -45,6 +45,6 @@ "packFolders": [], "url": "https://github.com/cptn-cosmo/dh-stream-overlay", "manifest": "https://git.geeks.gay/cosmo/dh-stream-overlay/raw/branch/main/module.json", - "download": "https://git.geeks.gay/cosmo/dh-stream-overlay/releases/download/2.0.0/dh-stream-overlay.zip", + "download": "https://git.geeks.gay/cosmo/dh-stream-overlay/releases/download/2.0.1/dh-stream-overlay.zip", "description": "A stream overlay module for Daggerheart that displays chat and a linked party actor sheet." } \ No newline at end of file diff --git a/scripts/module.js b/scripts/module.js index 96c0080..5884dcd 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -278,6 +278,26 @@ Hooks.once("init", () => { onChange: () => { if (document.body.classList.contains("stream")) location.reload(); } }); + game.settings.register("dh-stream-overlay", "carouselHidePlayers", { + name: "DH_STREAM_OVERLAY.Settings.CarouselHidePlayers", + hint: "DH_STREAM_OVERLAY.Settings.CarouselHidePlayersHint", + scope: "world", + config: true, + type: Boolean, + default: false, + onChange: () => { if (document.body.classList.contains("stream")) location.reload(); } + }); + + game.settings.register("dh-stream-overlay", "carouselHidePartyActor", { + name: "DH_STREAM_OVERLAY.Settings.CarouselHidePartyActor", + hint: "DH_STREAM_OVERLAY.Settings.CarouselHidePartyActorHint", + scope: "world", + config: true, + type: Boolean, + default: false, + onChange: () => { if (document.body.classList.contains("stream")) location.reload(); } + }); + }); // ============================================================================= @@ -504,10 +524,12 @@ function renderPartyOverlay(container) { let carouselEnabled = false; let carouselEffect = "fade"; let carouselGMMode = "cycle"; + let carouselHidePartyActor = false; try { carouselEnabled = game.settings.get("dh-stream-overlay", "carouselEnabled"); carouselEffect = game.settings.get("dh-stream-overlay", "carouselEffect"); carouselGMMode = game.settings.get("dh-stream-overlay", "carouselGMMode"); + carouselHidePartyActor = game.settings.get("dh-stream-overlay", "carouselHidePartyActor"); } catch (e) { } const renderPips = (val, max, type) => { @@ -578,6 +600,9 @@ function renderPartyOverlay(container) { players.forEach(user => { const actor = user.character; if (!actor) return; + + // Filter Party Actor from Carousel if enabled + if (carouselEnabled && carouselHidePartyActor && actor.type.toLowerCase() === "party") return; const system = actor.system || {}; const items = actor.items; @@ -759,21 +784,36 @@ function renderPartyOverlay(container) { let carouselClass = `carousel-mode effect-${carouselEffect}`; // GM Logic + // Check hide players setting + let hidePlayers = false; + try { hidePlayers = game.settings.get("dh-stream-overlay", "carouselHidePlayers"); } catch (e) { } + if (carouselGMMode === "static") { // Static grid for GM, Carousel for Players // Wrap in a flex container container.innerHTML = ` `; } else if (carouselGMMode === "hidden") { // Only Players in Carousel - container.innerHTML = `
${playerHtml}
`; + if (!hidePlayers && players.length > 0) { + container.innerHTML = `
${playerHtml}
`; + } else { + container.innerHTML = ""; // Nothing to show + } } else { // "cycle" or default - Mixed - container.innerHTML = `
${gmHtml}${playerHtml}
`; + let mixedContent = gmHtml; + if (!hidePlayers) mixedContent += playerHtml; + + if (mixedContent) { + container.innerHTML = `
${mixedContent}
`; + } else { + container.innerHTML = ""; + } } } else { From 43a7ef4f543524a90e4bf72e399af4ecaf98fc34 Mon Sep 17 00:00:00 2001 From: CPTN Cosmo Date: Sat, 24 Jan 2026 15:41:04 +0100 Subject: [PATCH 2/2] Enhance carousel transitions with customizable duration and an option to disable fade for the slide effect. --- languages/de.json | 4 ++++ languages/en.json | 4 ++++ module.json | 4 ++-- scripts/module.js | 45 +++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/languages/de.json b/languages/de.json index 570a5c1..8fda6ff 100644 --- a/languages/de.json +++ b/languages/de.json @@ -45,6 +45,10 @@ "CarouselSpeedHint": "Sekunden, die jede Karte angezeigt wird, bevor gewechselt wird.", "CarouselEffect": "Übergangseffekt", "CarouselEffectHint": "Animationseffekt beim Wechseln der Karten.", + "CarouselDisableFade": "Verblassen für Slide-Effekt deaktivieren", + "CarouselDisableFadeHint": "Wenn aktiviert und der 'Gleiten' Effekt gewählt ist, bleiben die Karten während des Übergangs voll sichtbar (Klassisches Karussell).", + "CarouselTransitionDuration": "Übergangsdauer (ms)", + "CarouselTransitionDurationHint": "Wie lange die Animation dauert (Standard: 800ms).", "CarouselGMMode": "GM Karussell-Verhalten", "CarouselGMModeHint": "Wie der GM im Karussell dargestellt werden soll.", "CarouselHidePlayers": "Spieler im Karussell verbergen", diff --git a/languages/en.json b/languages/en.json index 82fa18a..7738cc9 100644 --- a/languages/en.json +++ b/languages/en.json @@ -53,6 +53,10 @@ "CarouselSpeedHint": "Seconds to show each player card before switching.", "CarouselEffect": "Transition Effect", "CarouselEffectHint": "Animation effect when switching cards.", + "CarouselDisableFade": "Disable Fade for Slide Effect", + "CarouselDisableFadeHint": "If enabled and using 'Slide' effect, cards will maintain full opacity during transition (Classic Carousel).", + "CarouselTransitionDuration": "Transition Duration (ms)", + "CarouselTransitionDurationHint": "How long the animation takes (Default: 800ms).", "CarouselGMMode": "GM Carousel Behavior", "CarouselGMModeHint": "How the GM should constitute in the carousel.", "CarouselHidePlayers": "Hide Players in Carousel", diff --git a/module.json b/module.json index 94e6031..7391d12 100644 --- a/module.json +++ b/module.json @@ -1,7 +1,7 @@ { "id": "dh-stream-overlay", "title": "Daggerheart Stream Overlay", - "version": "2.0.1", + "version": "2.1.0", "compatibility": { "minimum": "13", "verified": "13" @@ -45,6 +45,6 @@ "packFolders": [], "url": "https://github.com/cptn-cosmo/dh-stream-overlay", "manifest": "https://git.geeks.gay/cosmo/dh-stream-overlay/raw/branch/main/module.json", - "download": "https://git.geeks.gay/cosmo/dh-stream-overlay/releases/download/2.0.1/dh-stream-overlay.zip", + "download": "https://git.geeks.gay/cosmo/dh-stream-overlay/releases/download/2.1.0/dh-stream-overlay.zip", "description": "A stream overlay module for Daggerheart that displays chat and a linked party actor sheet." } \ No newline at end of file diff --git a/scripts/module.js b/scripts/module.js index 5884dcd..5fe2b7e 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -263,6 +263,27 @@ Hooks.once("init", () => { onChange: () => { if (document.body.classList.contains("stream")) location.reload(); } }); + game.settings.register("dh-stream-overlay", "carouselDisableFade", { + name: "DH_STREAM_OVERLAY.Settings.CarouselDisableFade", + hint: "DH_STREAM_OVERLAY.Settings.CarouselDisableFadeHint", + scope: "world", + config: true, + type: Boolean, + default: false, + onChange: () => { if (document.body.classList.contains("stream")) location.reload(); } + }); + + game.settings.register("dh-stream-overlay", "carouselTransitionDuration", { + name: "DH_STREAM_OVERLAY.Settings.CarouselTransitionDuration", + hint: "DH_STREAM_OVERLAY.Settings.CarouselTransitionDurationHint", + scope: "world", + config: true, + type: Number, + default: 800, + range: { min: 200, max: 5000, step: 100 }, + onChange: () => { if (document.body.classList.contains("stream")) location.reload(); } + }); + game.settings.register("dh-stream-overlay", "carouselGMMode", { name: "DH_STREAM_OVERLAY.Settings.CarouselGMMode", hint: "DH_STREAM_OVERLAY.Settings.CarouselGMModeHint", @@ -1118,6 +1139,13 @@ function injectStyles() { const useGreen = game.settings.get("dh-stream-overlay", "useGreenScreen"); const autoExpand = game.settings.get("dh-stream-overlay", "autoExpandChat"); const hideActions = game.settings.get("dh-stream-overlay", "hideChatActions"); + + // New Carousel Settings + const carouselEffect = game.settings.get("dh-stream-overlay", "carouselEffect"); + const disableFade = game.settings.get("dh-stream-overlay", "carouselDisableFade"); // Only applies if Slide usually + const transitionDuration = game.settings.get("dh-stream-overlay", "carouselTransitionDuration") || 800; + const durationSec = transitionDuration / 1000; + const bgColor = useGreen ? "#00ff00" : "rgba(0, 0, 0, 0)"; const style = document.createElement("style"); @@ -1662,10 +1690,17 @@ function injectStyles() { .dh-party-grid.carousel-mode .dh-party-card { grid-area: 1 / 1 / -1 / -1; /* Stack on top of each other */ - opacity: 0; + + /* Default State (Hidden/Exiting) */ + ${(disableFade && carouselEffect === 'slide') ? 'opacity: 1;' : 'opacity: 0;'} visibility: hidden; + /* TRANSITION FIX: Delay visibility hide so it fades out first */ - transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out, visibility 0s linear 0.8s; + /* If Fade Disabled, we still need transition for Transform */ + transition: ${(disableFade && carouselEffect === 'slide') ? + `transform ${durationSec}s ease-in-out, visibility 0s linear ${durationSec}s` : + `opacity ${durationSec}s ease-in-out, transform ${durationSec}s ease-in-out, visibility 0s linear ${durationSec}s`}; + pointer-events: none; width: 100%; max-width: 600px; /* Constrain width in carousel */ @@ -1677,7 +1712,9 @@ function injectStyles() { opacity: 1; visibility: visible; /* Show immediately */ - transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out, visibility 0s linear; + transition: ${(disableFade && carouselEffect === 'slide') ? + `transform ${durationSec}s ease-in-out, visibility 0s linear` : + `opacity ${durationSec}s ease-in-out, transform ${durationSec}s ease-in-out, visibility 0s linear`}; pointer-events: auto; z-index: 10; transform: none; @@ -1689,7 +1726,7 @@ function injectStyles() { /* Slide */ .dh-party-grid.carousel-mode.effect-slide .dh-party-card { - transform: translateX(50px); + transform: translateX(120%); } .dh-party-grid.carousel-mode.effect-slide .dh-party-card.active-slide { transform: translateX(0);