From 54b78cf3ba802f1d4a8b5b86c345d90dc1974d30 Mon Sep 17 00:00:00 2001 From: MrVauxs <32039708+MrVauxs@users.noreply.github.com> Date: Mon, 18 Jul 2022 17:58:26 +0200 Subject: [PATCH] Add a setting for the min. scale of pop-out tokens Adds #67 --- scripts/dorako-ui.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/dorako-ui.js b/scripts/dorako-ui.js index a8cc194..3530968 100644 --- a/scripts/dorako-ui.js +++ b/scripts/dorako-ui.js @@ -218,7 +218,7 @@ Hooks.once("init", async function () { if (!border && popoutTokenPortraits) { const tk = canvas.tokens?.get(message.speaker.token); const scale = tk?.data.scale; - if (scale >= 1.5) { + if (scale >= game.settings.get("pf2e-dorako-ui", "popout-token-portraits-scale")) { sizeClass = "scale-up "; } } @@ -498,6 +498,23 @@ Hooks.once("init", async function () { debouncedReload(); }, }); + + game.settings.register("pf2e-dorako-ui", "popout-token-portraits-scale", { + name: "Chat portrait token popout scale", + hint: "Set the minimum threshold for the token scale to be 'popped out' of the chat portraits.", + scope: "client", + type: Number, + default: 1.5, + range: { + min: 0.2, + max: 3, + step: 0.1, + }, + config: true, + onChange: () => { + debouncedReload(); + }, + }); game.settings.register("pf2e-dorako-ui", "chat-portrait-border", { name: "... and add a border?",