COrrections, WIP

This commit is contained in:
2026-04-24 22:04:09 +02:00
parent d75b6cb945
commit e200b5f7b0
126 changed files with 768 additions and 5805 deletions

View File

@@ -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;