Merge branch 'feature/Active-Effect-Autocomplete' of https://github.com/Foundryborne/daggerheart into feature/Active-Effect-Autocomplete

This commit is contained in:
moliloo 2025-07-14 23:49:34 -03:00
commit 1ecce746b0
4 changed files with 32 additions and 10 deletions

View file

@ -1016,7 +1016,7 @@
"physicalDamage": "Physical Damage", "physicalDamage": "Physical Damage",
"magicalDamage": "Magical Damage", "magicalDamage": "Magical Damage",
"primaryDamageBonus": "Primary Weapon Damage", "primaryDamageBonus": "Primary Weapon Damage",
"primaryDamageDice": "Primary Weapon Extra Dice" "primaryDamageDice": "Primary Weapon Extra Damage Dice"
}, },
"DamageResistance": { "DamageResistance": {
"none": "None", "none": "None",
@ -1115,13 +1115,28 @@
}, },
"Rules": { "Rules": {
"damageReduction": { "damageReduction": {
"increasePerArmorMark": "Damage Reduction per Armor Slot", "increasePerArmorMark": {
"label": "Damage Reduction per Armor Slot",
"hint": "A used armor slot normally reduces damage by one step. This value increases the number of steps damage is reduced by."
},
"maxArmorMarkedBonus": "Max Armor Used", "maxArmorMarkedBonus": "Max Armor Used",
"maxArmorMarkedStress": "Max Armor Used With Stress", "maxArmorMarkedStress": {
"label": "Max Armor Used With Stress",
"hint": "If this value is set you can use up to that much stress to spend additional Armor Marks beyond your normal maximum."
},
"stress": { "stress": {
"severe": "Stress Damage Reduction: Severe", "severe": {
"major": "Stress Damage Reduction: Major", "label": "Stress Damage Reduction: Severe",
"minor": "Stress Damage Reduction: Minor" "hint": "The cost in stress you can pay to reduce severe damage down to major."
},
"major": {
"label": "Stress Damage Reduction: Major",
"hint": "The cost in stress you can pay to reduce major damage down to minor."
},
"minor": {
"label": "Stress Damage Reduction: Minor",
"hint": "The cost in stress you can pay to reduce minor damage to none."
}
} }
} }
}, },

View file

@ -73,6 +73,9 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
const element = document.createElement('li'); const element = document.createElement('li');
element.innerHTML = `${beforeText}${matchText ? `<strong>${matchText}</strong>` : ''}${after}`; element.innerHTML = `${beforeText}${matchText ? `<strong>${matchText}</strong>` : ''}${after}`;
if (item.hint) {
element.dataset.tooltip = game.i18n.localize(item.hint);
}
return element; return element;
}, },

View file

@ -179,7 +179,8 @@ export default class DhCharacter extends BaseDataActor {
required: true, required: true,
integer: true, integer: true,
initial: 0, initial: 0,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress' label: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress.label',
hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.maxArmorMarkedStress.hint'
}) })
}), }),
stressDamageReduction: new fields.SchemaField({ stressDamageReduction: new fields.SchemaField({
@ -190,7 +191,8 @@ export default class DhCharacter extends BaseDataActor {
increasePerArmorMark: new fields.NumberField({ increasePerArmorMark: new fields.NumberField({
integer: true, integer: true,
initial: 1, initial: 1,
label: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark' label: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.label',
hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.hint'
}), }),
magical: new fields.BooleanField({ initial: false }), magical: new fields.BooleanField({ initial: false }),
physical: new fields.BooleanField({ initial: false }) physical: new fields.BooleanField({ initial: false })

View file

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