From 64e3cc4f059098379018402d655d77faf2a9c1b5 Mon Sep 17 00:00:00 2001 From: cptn-cosmo Date: Sun, 31 Aug 2025 23:29:05 +0200 Subject: [PATCH] resolved an issue with the button not working --- module.json | 4 ++-- scripts/dr-button.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/module.json b/module.json index 2b74d94..5900e46 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "id": "duality-roller", "title": "Duality Dice Roller", "description": "Adds a button next to the chat dice/controls that triggers the /dr command for the Foundryborne Daggerheart system.", - "version": "0.1.2", + "version": "0.1.3", "compatibility": { "minimum": "13", "verified": "13" @@ -16,5 +16,5 @@ "languages": [], "url": "https://github.com/cptn-cosmo/DualityDiceRoller", "manifest": "https://github.com/cptn-cosmo/DualityDiceRoller/releases/latest/download/module.json", - "download": "https://github.com/cptn-cosmo/DualityDiceRoller/releases/download/0.1.2/duality-roller.zip" + "download": "https://github.com/cptn-cosmo/DualityDiceRoller/releases/download/0.1.3/duality-roller.zip" } diff --git a/scripts/dr-button.js b/scripts/dr-button.js index 603807b..60ab202 100644 --- a/scripts/dr-button.js +++ b/scripts/dr-button.js @@ -61,7 +61,14 @@ function addDRButton(html) { await runDRCommand(); }); - container.appendChild(btn); // fallback if fewer than 4 buttons + // Append the button at the end of the roll-privacy div + const rollPrivacyDiv = container.querySelector("#roll-privacy"); + if (rollPrivacyDiv) { + rollPrivacyDiv.appendChild(btn); + } else { + container.appendChild(btn); // fallback if the div doesn't exist + } + } catch (err) { console.error("DR Quick Button | addDRButton error:", err); }