finalising the autocomplete helper, and added to technique skillids

This commit is contained in:
Vlyan
2022-02-18 22:33:47 +01:00
parent 193a10daed
commit a876bfa122
5 changed files with 65 additions and 24 deletions

View File

@@ -48,6 +48,31 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
return super._updateObject(event, formData);
}
/**
* Listen to html elements
* @param {jQuery} html HTML content of the sheet.
* @override
*/
activateListeners(html) {
super.activateListeners(html);
// *** Everything below here is only needed if the sheet is editable ***
if (!this.isEditable) {
return;
}
// Autocomplete
game.l5r5e.HelpersL5r5e.autocomplete(
html,
"data.skill",
Array.from(game.l5r5e.HelpersL5r5e.getCategoriesSkillsList()).reduce((acc, [cat, skills]) => {
acc.push(cat, ...skills);
return acc;
}, []),
","
);
}
/**
* Sanitize the technique difficulty
* @param {string} str