diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ac020..f0feac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## Release/Patch Notes +### 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 - Enhancement - Changed pause icon to be Delta Green logo. diff --git a/css/deltagreen.css b/css/deltagreen.css index c4e76b5..735e38f 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; } @@ -128,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-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, 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/module/roll/roll.js b/module/roll/roll.js index 11a4f2e..d7e9e69 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"; @@ -499,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); 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.)", diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index f96787e..1ad4599 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}}