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
@@ -156,7 +156,7 @@ async function scanClientSide(): Promise<JournalCompletions> {
if (attrs.role === "stat-modifiers") {
const id = attrs.id || `_mod_${filePath}_${stats.length}`;
const result = parseStatModifiers(body, filePath, id);
const result = parseStatModifiers(body, filePath, id, "player", attrs.extra["label"]);
stats.push(result.statDef);
stats.push(...result.modifierDefs);
statTemplates.push(result.template);