some factorisation

This commit is contained in:
Vlyan
2020-12-16 19:05:18 +01:00
parent d9d9f43423
commit 182219337d
30 changed files with 269 additions and 393 deletions

View File

@@ -20,32 +20,11 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isWeapon = true;
sheetData.data.isEquipment = true;
// Martial skills only
sheetData.data.skills = Array.from(L5R5E.skills)
.filter(([id, cat]) => cat === "martial")
.map(([id, cat]) => id);
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
}
/**
* Update item with values from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}