From 74b323c7715c82cf5d6785f638d7c1dc0b1ce5fd Mon Sep 17 00:00:00 2001 From: Aaron Lutomski Date: Sat, 30 May 2026 16:26:08 -0700 Subject: [PATCH] Fix a couple of errors. Make roll dialog verbiage clearer. --- lang/en.json | 4 ++-- module/sheets/mixins/typed-skill-mixin.js | 9 ++++++++- module/utils/world-migration.js | 10 ++++++++-- templates/actor/edit-stats.html | 2 +- templates/item/parts/motivation-header.html | 12 ++++++------ 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/lang/en.json b/lang/en.json index 1be7b18..dd2d873 100644 --- a/lang/en.json +++ b/lang/en.json @@ -317,13 +317,13 @@ "DG.ModifySkillRollDialogue.OriginalTarget": "Original Target:", "DG.ModifySkillRollDialogue.ModifierTooltip": "Enter a positive value to increase the target, or a negative value to decrease it.", "DG.ModifySkillRollDialogue.QuickModifiersHeader": "Quick Modifiers", - "DG.ModifySkillRollDialogue.QuickModifiersHint": "Apply a preset adjustment and roll immediately.", + "DG.ModifySkillRollDialogue.QuickModifiersHint": "Click one of the following to apply a preset adjustment and roll immediately.", "DG.ModifySkillRollDialogue.ModifierMuchHarder": "Makes the roll much harder", "DG.ModifySkillRollDialogue.ModifierHarder": "Makes the roll harder", "DG.ModifySkillRollDialogue.ModifierEasier": "Makes the roll easier", "DG.ModifySkillRollDialogue.ModifierMuchEasier": "Makes the roll much easier", "DG.ModifySkillRollDialogue.CustomModifierHeader": "Custom Modifier", - "DG.ModifySkillRollDialogue.CustomModifierHint": "Enter a positive or negative value to adjust the target.", + "DG.ModifySkillRollDialogue.CustomModifierHint": "For custom adjustments to the roll target, enter a positive or negative value and click the Roll button.", "DG.ModifySkillRollDialogue.InvalidModifier": "Enter a valid modifier to roll.", "DG.ModifyDamageRollDialogue.Weapon": "Weapon:", "DG.ModifyDamageRollDialogue.OuterModifierTooltip": "Use this field to modify the outer part of the formula, such as to double the result.", diff --git a/module/sheets/mixins/typed-skill-mixin.js b/module/sheets/mixins/typed-skill-mixin.js index 3828bab..aecf3b3 100644 --- a/module/sheets/mixins/typed-skill-mixin.js +++ b/module/sheets/mixins/typed-skill-mixin.js @@ -6,6 +6,7 @@ import { } from "../../profession/constants.js"; const { renderTemplate } = foundry.applications.handlebars; +const { ForcedDeletion } = foundry.data.operators; /** * @param {string} [selectedGroup] @@ -39,7 +40,13 @@ export default function TypedSkillMixin(Base) { }); break; case "delete": - this.actor.update({ [`system.typedSkills.-=${typedskill}`]: null }); + this.actor.update({ + system: { + typedSkills: { + [typedskill]: new ForcedDeletion(), + }, + }, + }); break; default: break; diff --git a/module/utils/world-migration.js b/module/utils/world-migration.js index 19b5a1d..4b77c00 100644 --- a/module/utils/world-migration.js +++ b/module/utils/world-migration.js @@ -1,5 +1,7 @@ import DG from "../config/index.js"; +const { ForcedDeletion } = foundry.data.operators; + const MIGRATION_VERSION = 2; const ACTOR_TYPES_WITH_SKILLS = ["agent", "npc", "unnatural"]; const OBSOLETE_WORLD_SETTINGS = [ @@ -41,8 +43,12 @@ export default async function runWorldMigration() { for (const actor of actors) { if (actor.system.skills?.ritual) { await actor.update({ - "system.skills.-=ritual": null, - "system.schemaVersion": MIGRATION_VERSION, + system: { + skills: { + ritual: new ForcedDeletion(), + }, + schemaVersion: MIGRATION_VERSION, + }, }); migratedActors += 1; } diff --git a/templates/actor/edit-stats.html b/templates/actor/edit-stats.html index fc9818a..ee4ccef 100644 --- a/templates/actor/edit-stats.html +++ b/templates/actor/edit-stats.html @@ -10,7 +10,7 @@
diff --git a/templates/item/parts/motivation-header.html b/templates/item/parts/motivation-header.html index aae0d69..ef17516 100644 --- a/templates/item/parts/motivation-header.html +++ b/templates/item/parts/motivation-header.html @@ -11,12 +11,6 @@ style="text-decoration: line-through" disabled {{/if }} /> - {{localize 'DG.ItemWindow.Motivations.AcuteEpisode'}}: - {{localize 'DG.ItemWindow.Motivations.IsDisorder'}}: + {{localize 'DG.ItemWindow.Motivations.AcuteEpisode'}}: + {{localize 'DG.ItemWindow.Motivations.DisorderHasBeenCured'}}: