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 {