diff --git a/lang/fr.json b/lang/fr.json index 8fa8f3fd..f857f204 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -28,7 +28,7 @@ "TypeArmure": "Armure", "TypeConteneur": "Conteneur", "TypeNourritureboisson": "Nourriture & boisson", - "TypeService": "Services/Boutique", + "TypeService": "Service", "TypeChant": "Chant", "TypeDanse": "Danse", "TypeMusique": "Musique", diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index 328e2b72..6cfc9e7e 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -77,7 +77,6 @@ export class RdDBaseActorSheet extends ActorSheet { /* -------------------------------------------- */ filterItemsPerTypeForSheet(formData, itemTypes) { - formData.services = Misc.arrayOrEmpty(itemTypes['service']); formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']); formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']); formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']); @@ -103,9 +102,8 @@ export class RdDBaseActorSheet extends ActorSheet { formData.oeuvres = Misc.arrayOrEmpty(itemTypes['oeuvre']); formData.jeux = Misc.arrayOrEmpty(itemTypes['jeu']); - + formData.services = Misc.arrayOrEmpty(itemTypes['service']); formData.conteneurs = Misc.arrayOrEmpty(itemTypes['conteneur']); - formData.materiel = Misc.arrayOrEmpty(itemTypes['objet']); formData.armes = Misc.arrayOrEmpty(itemTypes['arme']); formData.armures = Misc.arrayOrEmpty(itemTypes['armure']); @@ -117,22 +115,12 @@ export class RdDBaseActorSheet extends ActorSheet { formData.herbes = Misc.arrayOrEmpty(itemTypes['herbe']); formData.nourritureboissons = Misc.arrayOrEmpty(itemTypes['nourritureboisson']); formData.gemmes = Misc.arrayOrEmpty(itemTypes['gemme']); - formData.monnaie = Misc.arrayOrEmpty(itemTypes['monnaie']).sort(Monnaie.triValeurEntiere()); - formData.objets = formData.conteneurs - .concat(formData.materiel) - .concat(formData.armes) - .concat(formData.armures) - .concat(formData.munitions) - .concat(formData.livres) - .concat(formData.potions) - .concat(formData.ingredients) - .concat(formData.herbes) - .concat(formData.faunes) - .concat(formData.monnaie) - .concat(formData.nourritureboissons) - .concat(formData.gemmes); + formData.objets = RdDItem.getItemTypesInventaire('all') + .map(t => Misc.arrayOrEmpty(itemTypes[t])) + .reduce((a, b) => a.concat(b), []) + .sort(Misc.ascending(it => it.name)); } /* -------------------------------------------- */ /** @override */ @@ -205,7 +193,7 @@ export class RdDBaseActorSheet extends ActorSheet { /* -------------------------------------------- */ async selectObjetTypeToCreate() { - let typeObjets = RdDItem.getItemTypesInventaire(); + let typeObjets = this.getTypesInventaire().sort(Misc.ascending(type => Misc.typeName('Item', type))); let content = `Selectionnez le type d'équipement - {{#if @root.options.isOwner}} - - {{/if}} + {{#unless (or (eq item.type 'service') (and (eq item.type 'conteneur') (not vide)))}} + {{#if @root.options.isOwner}} + + {{/if}} + + {{#if @root.options.isOwner}} + + {{/if}} {{/unless}} {{/unless}} diff --git a/templates/item-service-sheet.html b/templates/item-service-sheet.html index 8e8f0ee0..bcb7de4f 100644 --- a/templates/item-service-sheet.html +++ b/templates/item-service-sheet.html @@ -2,69 +2,23 @@ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}}
-
- {{editor description target="system.description" button=true owner=owner editable=(or isGM isOwner) engine="prosemirror"}} -
- - Quantité en vente illimitée + Jet de moral en situation heureuse +
-
- + +
+ +
- {{#if isGM}} -
-
- -
- {{editor descriptionmj target="system.descriptionmj" button=true owner=owner editable=true engine="prosemirror"}} -
+ +
+ +
- {{/if}} + + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}