From 9934fe91913e54658315bf71046137c1688c57a3 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 28 Mar 2026 20:15:05 +0100 Subject: [PATCH] Le pluriel de jeu est jeux --- module/item.js | 12 ++++++++++++ module/rdd-utility.js | 4 ++-- templates/actor-sheet.hbs | 2 +- templates/actor/{jeus.hbs => jeux.hbs} | 0 4 files changed, 15 insertions(+), 3 deletions(-) rename templates/actor/{jeus.hbs => jeux.hbs} (100%) diff --git a/module/item.js b/module/item.js index 4a3ac55c..238f455a 100644 --- a/module/item.js +++ b/module/item.js @@ -85,6 +85,10 @@ export const defaultItemImg = { munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp" } +const ITEM_TYPES_PLURIEL = { + [ITEM_TYPES.jeu]: 'jeux' +} + /* -------------------------------------------- */ export class RdDItem extends Item { @@ -112,6 +116,14 @@ export class RdDItem extends Item { return true; } + + static itemTypePluriel(type) { + if (ITEM_TYPES[type]) { + return ITEM_TYPES_PLURIEL[type] ?? (type + 's') + } + console.error(`Item type ${type} is undefined`) + return type + } static async getCorrespondingItem(itemRef) { if (itemRef.pack) { return await SystemCompendiums.loadDocument(itemRef) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 265f73e8..66f36836 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -147,7 +147,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.hbs', - 'systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs', + 'systems/foundryvtt-reve-de-dragon/templates/actor/jeux.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs', @@ -483,7 +483,7 @@ export class RdDUtility { static filterItemsPerTypeForSheet(formData, itemTypes) { Object.values(ITEM_TYPES).forEach(t => { - formData[t + 's'] = Misc.arrayOrEmpty(itemTypes[t]) + formData[RdDItem.itemTypePluriel(t)] = Misc.arrayOrEmpty(itemTypes[t]) itemTypes[t].forEach(item => item.actions = item.itemActions()) }) diff --git a/templates/actor-sheet.hbs b/templates/actor-sheet.hbs index e1c471c6..967c23c2 100644 --- a/templates/actor-sheet.hbs +++ b/templates/actor-sheet.hbs @@ -122,7 +122,7 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeux.hbs"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs"}} {{/if}} diff --git a/templates/actor/jeus.hbs b/templates/actor/jeux.hbs similarity index 100% rename from templates/actor/jeus.hbs rename to templates/actor/jeux.hbs