feat: support custom labels for stat modifiers

Allows passing an optional label to `parseStatModifiers` to override
the default ID-based label. This enables more descriptive names in
the UI and improves how modifier labels are derived in the journal
view.
This commit is contained in:
2026-07-09 11:28:17 +08:00
parent ef71a43f0a
commit 4f3b03d082
5 changed files with 43 additions and 30 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ export function processBlocks(
if (attrs.role === "stat-modifiers") {
const id = attrs.id || `_mod_${contentHash(body)}`;
const result = parseStatModifiers(body, fileRelativePath, id);
const result = parseStatModifiers(body, fileRelativePath, id, "player", attrs.extra["label"]);
blocks.stats.push(result.statDef);
blocks.stats.push(...result.modifierDefs);
blocks.statTemplates.push(result.template);