Le pluriel de jeu est jeux

This commit is contained in:
2026-04-03 22:16:50 +02:00
parent e6c4f7990a
commit 9934fe9191
4 changed files with 15 additions and 3 deletions
+12
View File
@@ -85,6 +85,10 @@ export const defaultItemImg = {
munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp" munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp"
} }
const ITEM_TYPES_PLURIEL = {
[ITEM_TYPES.jeu]: 'jeux'
}
/* -------------------------------------------- */ /* -------------------------------------------- */
export class RdDItem extends Item { export class RdDItem extends Item {
@@ -112,6 +116,14 @@ export class RdDItem extends Item {
return true; 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) { static async getCorrespondingItem(itemRef) {
if (itemRef.pack) { if (itemRef.pack) {
return await SystemCompendiums.loadDocument(itemRef) return await SystemCompendiums.loadDocument(itemRef)
+2 -2
View File
@@ -147,7 +147,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs', '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/oeuvres.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.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/alchimie.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs',
@@ -483,7 +483,7 @@ export class RdDUtility {
static filterItemsPerTypeForSheet(formData, itemTypes) { static filterItemsPerTypeForSheet(formData, itemTypes) {
Object.values(ITEM_TYPES).forEach(t => { 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()) itemTypes[t].forEach(item => item.actions = item.itemActions())
}) })
+1 -1
View File
@@ -122,7 +122,7 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}} {{> "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/chirurgie.hbs"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.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"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs"}}
</div> </div>
{{/if}} {{/if}}