Added hints

This commit is contained in:
WBHarry 2025-07-15 03:30:41 +02:00
parent 52f62014f9
commit c4435e290e
4 changed files with 32 additions and 10 deletions

View file

@ -21,8 +21,10 @@ export default class DHToken extends TokenDocument {
const a = v.join('.');
if (invalidAttributes.some(x => a.startsWith(x))) return acc;
const modelLabel = model ? game.i18n.localize(model.schema.getField(a).label) : null;
acc.push({ group: valueGroup, value: a, label: modelLabel ? modelLabel : a });
const field = model ? model.schema.getField(a) : null;
const modelLabel = field ? game.i18n.localize(field.label) : null;
const hint = field ? game.i18n.localize(field.hint) : null;
acc.push({ group: valueGroup, value: a, label: modelLabel ? modelLabel : a, hint: hint });
return acc;
}, []);