From 87fb5300350e219236e8380247b02418b33022e7 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Thu, 28 Sep 2023 23:35:37 -0400 Subject: [PATCH 1/9] Fix conditionals for private san rolls --- module/roll/roll.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/module/roll/roll.js b/module/roll/roll.js index 11a4f2e..d887f14 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -132,12 +132,18 @@ export class DGPercentileRoll extends DGRoll { * @returns {Promise} - the results of the dialog. */ async showDialog() { - let isSanCheck = false; - const hideSanTarget = - !game.user.isGM && game.settings.get("deltagreen", "keepSanityPrivate"); + const privateSanSetting = game.settings.get( + "deltagreen", + "keepSanityPrivate", + ); - if (this.key === "sanity" || this.key === "ritual") { - isSanCheck = true; + let hideSanTarget = false; + if ( + privateSanSetting && + (this.type === "sanity" || this.key === "ritual") && + !game.user.isGM + ) { + hideSanTarget = true; } const backingData = { @@ -145,7 +151,6 @@ export class DGPercentileRoll extends DGRoll { label: this.localizedKey, originalTarget: this.target, targetModifier: 20, - isSanCheck, hideTarget: hideSanTarget, }, }; @@ -212,7 +217,7 @@ export class DGPercentileRoll extends DGRoll { ); if ( privateSanSetting && - (this.key === "sanity" || this.key === "ritual") && + (this.type === "sanity" || this.key === "ritual") && !game.user.isGM ) { rollMode = "blindroll"; From a06bef4b43b31ee9f1f4ef86e221858e40a4576d Mon Sep 17 00:00:00 2001 From: jalensailin Date: Thu, 28 Sep 2023 23:40:38 -0400 Subject: [PATCH 2/9] changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ac020..7af38aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Release/Patch Notes +### Version 1.3.2 - 2023-XX-XX + +- Fix [Github #87] - SAN rolls are hidden properly again if GM chooses. + ### Version 1.3.1 - 2023-09-23 - Enhancement - Changed pause icon to be Delta Green logo. From 9021a5eaee3c284de2dc5f35a147348517919ad5 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:01:38 -0700 Subject: [PATCH 3/9] fix css issue with non-editable character sheets --- css/deltagreen.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/deltagreen.css b/css/deltagreen.css index c4e76b5..a039623 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -48,6 +48,7 @@ } /* Override the default Foundry CSS to add the padding we removed from the outer window back in */ +.deltagreen section.window-content form.locked, .deltagreen section.window-content form.editable { padding: 6px 6px 6px 6px !important; } From 4a34dac082833f45533edf52178ff57eea66c6a5 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:09:11 -0700 Subject: [PATCH 4/9] re-add right-click handler for rolls --- module/actor/actor-sheet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index e55927d..a0c7b16 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -237,7 +237,8 @@ export default class DeltaGreenActorSheet extends ActorSheet { // Rollable abilities - bind to everything with the 'Rollable' class html.find(".rollable").click(this._onRoll.bind(this)); - + html.find('.rollable').contextmenu(this._onRoll.bind(this)); // this is for right-click, which triggers the roll modifier dialogue for most rolls + html.find(".toggle-untrained").click(() => this.actor.update({ "system.showUntrainedSkills": !this.actor.system.showUntrainedSkills, From 979dbf1df4b5349718fb857797ba34fbae53393d Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:50:41 -0700 Subject: [PATCH 5/9] change damage roll label --- module/roll/roll.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/module/roll/roll.js b/module/roll/roll.js index d887f14..d7e9e69 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -504,14 +504,10 @@ export class DGDamageRoll extends DGRoll { this.options.rollMode || game.settings.get("core", "rollMode"); let label = this.formula; try { - label = `${this.item.name}: ${game.i18n.localize( - "DG.Roll.Rolling", - )} ${game.i18n - .localize("DG.Roll.Damage") - .toUpperCase()} ${game.i18n.localize( - "DG.Roll.For", - )} ${label.toUpperCase()}`; - } catch { + label = `${game.i18n.localize("DG.Roll.Rolling",)} ${game.i18n.localize("DG.Roll.Damage"). + toUpperCase()} ${game.i18n.localize("DG.Roll.For",)} ${this.item.name}`; + } catch(ex) { + //console.log(ex); label = `Rolling DAMAGE for ${label.toUpperCase()}`; } return this.createMessage(this.total, label, rollMode); From 6afabfc9cccc6c48a99d7bb4c67074c955322415 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:34:39 -0700 Subject: [PATCH 6/9] trigger refresh on settings that require it --- module/settings.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/settings.js b/module/settings.js index 1b6cfcd..30b962e 100644 --- a/module/settings.js +++ b/module/settings.js @@ -26,6 +26,7 @@ export default function registerSystemSettings() { hint: "Hide sanity from players on both character sheet and rolls.", scope: "world", config: true, + requiresReload: true, type: Boolean, default: false, }); @@ -56,10 +57,12 @@ export default function registerSystemSettings() { hint: "Show Impossible Landscapes-specific fields from character sheets.", scope: "world", config: true, + requiresReload: true, type: Boolean, default: true, }); + // obsolete - will be removed at some point game.settings.register("deltagreen", "characterSheetFont", { name: "World Font Choice", hint: "Choose font style for use throughout this world.", @@ -83,6 +86,7 @@ export default function registerSystemSettings() { }, }); + // obsolete - will be removed at some point game.settings.register("deltagreen", "characterSheetBackgroundImageSetting", { name: "World Sheet Background Image", hint: "Choose background image for use throughout this world. (Refresh page to see change.)", From 04aa233f764f15aed61acd55b688c70822887180 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:34:47 -0700 Subject: [PATCH 7/9] fix broken tooltip --- templates/actor/actor-sheet.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index f96787e..0ed40de 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -54,7 +54,7 @@
{{#if (keepSanityPrivate)}} - + /
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
@@ -63,7 +63,7 @@ {{#unless (keepSanityPrivate)}} - + /
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
From 74290dcd7f9f53cb4450374d196e0bb9a2b99b51 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:51:32 -0700 Subject: [PATCH 8/9] changed SAN to reflect breaking point being hit --- css/deltagreen.css | 5 +++++ module/actor/actor.js | 7 +++++++ templates/actor/actor-sheet.html | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/css/deltagreen.css b/css/deltagreen.css index a039623..735e38f 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -129,6 +129,11 @@ form.program-style { color: #999999; } +input.breaking-point-hit{ + color: rgb(117, 0, 0); + font-weight: bold; +} + .dg-red { color: rgb(117, 0, 0); } diff --git a/module/actor/actor.js b/module/actor/actor.js index 2277226..4240a6c 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -223,6 +223,13 @@ export default class DeltaGreenActor extends Actor { system.sanity.adaptations.helplessness.isAdapted = false; } + if(system.sanity.value <= system.sanity.currentBreakingPoint){ + system.sanity.breakingPointHit = true; + } + else{ + system.sanity.breakingPointHit = false; + } + // calculate total armor rating let protection = 0; for (const i of agent.items) { diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 0ed40de..1ad4599 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -63,7 +63,7 @@ {{#unless (keepSanityPrivate)}} - + /
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
From a3ee01fb02510f6348a04f5cfc6c35b911c5aff0 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:05:07 -0700 Subject: [PATCH 9/9] update --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7af38aa..f0feac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ ### Version 1.3.2 - 2023-XX-XX +- Enhancement - When hitting a breakpoint, current SAN now turns bold and red, to help indicate you need to reset your breaking point. +- Fix [Github #86] - You can now right-click again to get the modify roll dialog, instead of just shift-click. - Fix [Github #87] - SAN rolls are hidden properly again if GM chooses. +- Fix [Github #97] - Fixed broken tooltip on SAN that did not show current break point anymore. ### Version 1.3.1 - 2023-09-23