mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
[Fix] Enricher fixes for [[fr]] and reaction argument lazy fix (#1586)
* Update utils.mjs * fixed reaction situation. * Made change in enricher instead of dialog * comment clarity
This commit is contained in:
parent
bae9470a4f
commit
6321c7c508
2 changed files with 3 additions and 2 deletions
|
|
@ -90,11 +90,12 @@ export const enrichedDualityRoll = async (
|
||||||
event: event ?? {},
|
event: event ?? {},
|
||||||
title: title,
|
title: title,
|
||||||
headerTitle: label,
|
headerTitle: label,
|
||||||
|
actionType: reaction ? 'reaction' : null,
|
||||||
roll: {
|
roll: {
|
||||||
trait: traitValue && target ? traitValue : null,
|
trait: traitValue && target ? traitValue : null,
|
||||||
difficulty: difficulty,
|
difficulty: difficulty,
|
||||||
advantage,
|
advantage,
|
||||||
type: reaction ? 'reaction' : null
|
// type: reaction ? 'reaction' : null //not needed really but keeping it for troubleshooting
|
||||||
},
|
},
|
||||||
skips: {
|
skips: {
|
||||||
resources: !grantResources,
|
resources: !grantResources,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export function rollCommandToJSON(text) {
|
||||||
const flavor = flavorMatch ? flavorMatch[1] : null;
|
const flavor = flavorMatch ? flavorMatch[1] : null;
|
||||||
|
|
||||||
// Match key="quoted string" OR key=unquotedValue
|
// Match key="quoted string" OR key=unquotedValue
|
||||||
const PAIR_RE = /(\w+)=("(?:[^"\\]|\\.)*"|\S+)/g;
|
const PAIR_RE = /(\w+)\s*=\s*("(?:[^"\\]|\\.)*"|[^\]\}\s]+)/g; //updated regex to allow escaped quotes in quoted strings and avoid matching closing brackets/braces
|
||||||
const result = {};
|
const result = {};
|
||||||
for (const [, key, raw] of text.matchAll(PAIR_RE)) {
|
for (const [, key, raw] of text.matchAll(PAIR_RE)) {
|
||||||
let value;
|
let value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue