COrrections, WIP
This commit is contained in:
@@ -15,18 +15,21 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
|
||||
async getData(options = {}) {
|
||||
const sheetData = await super.getData(options);
|
||||
|
||||
// Martial skills only
|
||||
// Only these four skills are relevant for weapons
|
||||
const allowedSkills = ["archery", "unarmed", "melee", "invocation"];
|
||||
sheetData.data.skills = Array.from(CONFIG.l5r5e.skills)
|
||||
.filter(([id, cat]) => cat === "martial")
|
||||
.filter(([id]) => allowedSkills.includes(id))
|
||||
.map(([id, cat]) => ({
|
||||
id,
|
||||
label: "l5r5e.skills." + cat.toLowerCase() + "." + id.toLowerCase(),
|
||||
}));
|
||||
|
||||
// Weapon categories (Chiaroscuro)
|
||||
// Weapon categories (Chiaroscuro) — sorted alphabetically
|
||||
const catObj = game.l5r5e.HelpersL5r5e.getLocalizedRawObject("chiaroscuro.weapon.categories") ?? {};
|
||||
sheetData.data.weaponCategories = [{ id: "", label: "—" }].concat(
|
||||
Object.entries(catObj).map(([id, label]) => ({ id, label }))
|
||||
Object.entries(catObj)
|
||||
.map(([id, label]) => ({ id, label }))
|
||||
.sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: "base" }))
|
||||
);
|
||||
|
||||
return sheetData;
|
||||
|
||||
Reference in New Issue
Block a user