diff --git a/src/module/system/text-editor.ts b/src/module/system/text-editor.ts index dcb6e8c595c..38fce0528d0 100644 --- a/src/module/system/text-editor.ts +++ b/src/module/system/text-editor.ts @@ -449,7 +449,13 @@ class TextEditorPF2e extends foundry.applications.ux.TextEditor { // statistic const statistic = (params["statistic"] || params["stat"] || params["skill"])?.trim(); - if ((dc && showDC) || statistic) { + // "false" or "never" to never show + const showStatisticOverride = (params["show-statistic"] || params["show-stat"] || params["show-skill"]) + ?.trim() + .toLowerCase(); + const showStatistic = statistic && !(showStatisticOverride === "false" || showStatisticOverride === "never"); + + if ((dc && showDC) || showStatistic) { element.appendChild(document.createTextNode(" ")); const details = document.createElement("span"); @@ -457,7 +463,7 @@ class TextEditorPF2e extends foundry.applications.ux.TextEditor { if (!Number.isNumeric(dc)) { // (Statistic vs Defense DC) const defense = game.i18n.localize(`PF2E.Check.DC.Specific.${dc}`); - const text = statistic + const text = showStatistic ? game.i18n.format("PF2E.InlineAction.Check.StatisticVsDefense", { defense, statistic: ActionMacroHelpers.getSimpleCheckLabel(statistic) || statistic, @@ -470,7 +476,9 @@ class TextEditorPF2e extends foundry.applications.ux.TextEditor { dataset: { visibility }, children: [game.i18n.format("PF2E.InlineAction.Check.DC", { dc })], }); - const end = statistic ? ` ${ActionMacroHelpers.getSimpleCheckLabel(statistic) || statistic})` : ")"; + const end = showStatistic + ? ` ${ActionMacroHelpers.getSimpleCheckLabel(statistic) || statistic})` + : ")"; details.append("(", span, end); } else { // (DC #) @@ -478,7 +486,7 @@ class TextEditorPF2e extends foundry.applications.ux.TextEditor { details.innerText = `(${game.i18n.format("PF2E.InlineAction.Check.DC", { dc })})`; } } else { - // (Statistic) + // (showStatistic) const text = ActionMacroHelpers.getSimpleCheckLabel(statistic) || statistic; details.innerText = `(${text})`; }