From 61474172a78ad92db497525a8a6a8373f8356aef Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 28 Jan 2023 11:35:33 +0100 Subject: [PATCH 1/6] =?UTF-8?q?Fix:=20gestion=20de=20la=20fen=C3=AAtre=20d?= =?UTF-8?q?e=20vente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit les nombre de lots ne marchaient plus (toujourts 1 de proposé) --- module/dialog-item-vente.js | 51 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/module/dialog-item-vente.js b/module/dialog-item-vente.js index 5b6a62ce..fed81902 100644 --- a/module/dialog-item-vente.js +++ b/module/dialog-item-vente.js @@ -8,7 +8,7 @@ export class DialogItemVente extends Dialog { const venteData = { item: item, alias: item.actor?.name ?? game.user.name, - vendeurId: item.actor?.id , + vendeurId: item.actor?.id, prixOrigine: item.calculerPrixCommercant(), prixUnitaire: item.calculerPrixCommercant(), prixLot: item.calculerPrixCommercant(), @@ -40,51 +40,62 @@ export class DialogItemVente extends Dialog { activateListeners(html) { super.activateListeners(html); + this.html = html; - this.setQuantiteIllimite(this.venteData.quantiteIllimite); this.html.find(".tailleLot").change(event => this.setTailleLot(Number(event.currentTarget.value))); this.html.find(".quantiteNbLots").change(event => this.setNbLots(Number(event.currentTarget.value))); this.html.find(".quantiteIllimite").change(event => this.setQuantiteIllimite(event.currentTarget.checked)); this.html.find(".prixLot").change(event => this.setPrixLot(Number(event.currentTarget.value))); + + this.setQuantiteIllimite(this.venteData.quantiteIllimite); } async onProposer(it) { - await this.html.find(".tailleLot").change(); - await this.html.find(".quantiteNbLots").change(); - await this.html.find(".quantiteIllimite").change(); - await this.html.find(".prixLot").change(); + this.updateVente(this.getChoixVente()); this.callback(this.venteData); } + updateVente(update) { + mergeObject(this.venteData, update); + } + + getChoixVente() { + return { + quantiteNbLots: Number(this.html.find(".quantiteNbLots").val()), + tailleLot: Number(this.html.find(".tailleLot").val()), + quantiteIllimite: this.html.find(".quantiteIllimite").is(':checked'), + prixLot: Number(this.html.find(".prixLot").val()) + }; + } + /* -------------------------------------------- */ setPrixLot(prixLot) { this.venteData.prixLot = prixLot; } setTailleLot(tailleLot) { - // recalculer le prix du lot - if (tailleLot != this.venteData.tailleLot) { - this.venteData.prixLot = (tailleLot * this.venteData.prixOrigine).toFixed(2); - this.html.find(".prixLot").val(this.venteData.prixLot); - } - this.venteData.tailleLot = tailleLot; - // recalculer le nombre de lots max - this.venteData.quantiteMaxLots = Math.floor(this.venteData.quantiteMax / tailleLot); - this.venteData.quantiteNbLots = Math.min(this.venteData.quantiteMaxLots, this.venteData.quantiteNbLots); + const maxLots = Math.floor(this.venteData.quantiteMax / tailleLot); + this.updateVente({ + tailleLot, + quantiteNbLots: Math.min(maxLots, this.venteData.quantiteNbLots), + quantiteMaxLots: maxLots, + prixLot: (tailleLot * this.venteData.prixOrigine).toFixed(2) + }); + + this.html.find(".prixLot").val(this.venteData.prixLot); this.html.find(".quantiteNbLots").val(this.venteData.quantiteNbLots); this.html.find(".quantiteNbLots").attr("max", this.venteData.quantiteMaxLots) } setNbLots(nbLots) { - if (this.venteData.isOwned) { - nbLots = Math.max(0, Math.min(nbLots, this.venteData.quantiteMaxLots)); - } - this.venteData.quantiteNbLots = nbLots; + this.updateVente({ + quantiteNbLots: this.venteData.isOwned ? Math.max(0, Math.min(nbLots, this.venteData.quantiteMaxLots)) : nbLots + }) this.html.find(".quantiteNbLots").val(this.venteData.quantiteNbLots); } setQuantiteIllimite(checked) { - this.venteData.quantiteIllimite = checked; + this.updateVente({ quantiteIllimite: checked }) this.html.find(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles"); HtmlUtility.showControlWhen(this.html.find(".quantiteNbLots"), !this.venteData.quantiteIllimite) } From 4d5651c2d3872e9ba9f2982e8b5c44c71086e86d Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 28 Jan 2023 15:43:31 +0100 Subject: [PATCH 2/6] Reprise de l'arbre d'inventaire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Soucis lors de l'affichage dans la fenêtre d'un conteneur --- module/item/sheet-conteneur.js | 7 +- module/rdd-utility.js | 81 +++++++++++++++--------- templates/actor/commerce-inventaire.html | 9 ++- templates/actor/inventaire-item.html | 6 +- templates/actor/inventaire.html | 4 +- templates/item-conteneur-sheet.html | 5 +- 6 files changed, 66 insertions(+), 46 deletions(-) diff --git a/module/item/sheet-conteneur.js b/module/item/sheet-conteneur.js index b5ff7855..fc0f7948 100644 --- a/module/item/sheet-conteneur.js +++ b/module/item/sheet-conteneur.js @@ -29,7 +29,6 @@ export class RdDConteneurItemSheet extends RdDItemInventaireSheet { /* -------------------------------------------- */ prepareConteneurData(formData) { RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); - this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems; } @@ -44,7 +43,8 @@ export class RdDConteneurItemSheet extends RdDItemInventaireSheet { const dragData = { actorId: this.actor.id, type: "Item", - data: item.system + data: item.system, + uuid: item.uuid }; event.dataTransfer.setData("text/plain", JSON.stringify(dragData)); @@ -52,7 +52,8 @@ export class RdDConteneurItemSheet extends RdDItemInventaireSheet { async _onDropItem(event, dragData) { if (this.actor) { - const dropParams = await RdDSheetUtility.prepareItemDropParameters(this.item.id, this.actor, dragData, this.objetVersConteneur); + const destItemId = this.html.find(event.target)?.closest('.item').attr('data-item-id') ?? this.item.id + const dropParams = await RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor, dragData, this.objetVersConteneur); await this.actor.processDropItem(dropParams); await this.render(true); } diff --git a/module/rdd-utility.js b/module/rdd-utility.js index ef8a1000..d0b8ccb5 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -278,8 +278,9 @@ export class RdDUtility { Handlebars.registerHelper('apostrophe', (article, str) => Grammar.apostrophe(article, str)); Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str)); Handlebars.registerHelper('accord', (genre, ...args) => Grammar.accord(genre, args)); - Handlebars.registerHelper('buildConteneur', (objet, templateItem, options) => { return new Handlebars.SafeString(RdDUtility.buildConteneur(objet, 1, templateItem, options)); }); - Handlebars.registerHelper('buildContenu', (objet) => { return new Handlebars.SafeString(RdDUtility.buildContenu(objet, 1, true)); }); + Handlebars.registerHelper('buildLigneInventaire', (item, options) => { return new Handlebars.SafeString(RdDUtility.buildLigneInventaire(item, options)); }); + Handlebars.registerHelper('buildInventaireConteneur', (actorId, itemId, options) => { return new Handlebars.SafeString(RdDUtility.buildInventaireConteneur(actorId, itemId, options)); }); + Handlebars.registerHelper('buildContenuConteneur', (item, options) => { return new Handlebars.SafeString(RdDUtility.buildContenuConteneur(item, options)); }); Handlebars.registerHelper('calculerPrixCommercant', item => item.calculerPrixCommercant()); Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord)); Handlebars.registerHelper('caseTmr-type', coord => TMRUtility.getTMRType(coord)); @@ -394,38 +395,58 @@ export class RdDUtility { return conteneurs.filter((conteneur, index, arr) => !conteneur.estContenu); } - /* -------------------------------------------- */ - /** Construit la structure récursive des conteneurs, avec imbrication potentielle - * - */ - static buildConteneur(objet, profondeur, templateItem, options) { - if (!profondeur) profondeur = 1; - if (!templateItem) templateItem = 'actor/inventaire-item.html' - objet.niveau = profondeur; - - const isConteneur = objet.type == 'conteneur'; - const isOuvert = isConteneur && this.getAfficheContenu(objet._id); - const isVide = isConteneur && objet.system.contenu.length == 0; - const conteneur = Handlebars.partials[`systems/foundryvtt-reve-de-dragon/templates/${templateItem}`]({ - item: objet, - vide: isVide, - ouvert: isOuvert, - options: options - }); - const contenu = isConteneur ? RdDUtility.buildContenu(objet, profondeur, isOuvert, templateItem, options) : ''; - return conteneur + contenu; + static prepareOptionsArbreInventaire(item, optionsArbre) { + if (!optionsArbre.profondeur) { + optionsArbre.profondeur = 1 + }; + if (!optionsArbre.templateItem) { + optionsArbre.templateItem = item.parent?.type == 'commerce' + ? "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.html" + : "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.html"; + } + item.niveau = optionsArbre.profondeur; } /* -------------------------------------------- */ - static buildContenu(objet, profondeur, afficherContenu, templateItem, options) { - if (!profondeur) profondeur = 1; - if (!templateItem) templateItem = 'actor/inventaire-item.html' - objet.niveau = profondeur; - const display = afficherContenu ? 'item-display-show' : 'item-display-hide'; - let strContenu = ` diff --git a/templates/actor/inventaire-item.html b/templates/actor/inventaire-item.html index a1f25f49..25e5984b 100644 --- a/templates/actor/inventaire-item.html +++ b/templates/actor/inventaire-item.html @@ -1,4 +1,4 @@ -{{#if (or @root.options.isObserver (ne item.type 'monnaie'))}} +{{#if (or options.isObserver (ne item.type 'monnaie'))}}
  • {{#if (eq item.type 'conteneur')}} @@ -21,7 +21,7 @@ {{numberFormat item.system.encTotal decimals=2}} - {{#if @root.options.isOwner}} + {{#if options.isOwner}} {{#unless item.estContenu}} {{#if (or (eq item.type 'arme') (eq item.type 'armure') )}} {{#if item.system.equipe}}{{else}}{{/if}} @@ -35,7 +35,7 @@ {{/if}} {{/if}} - {{#if @root.options.isOwner}} + {{#if options.isOwner}} {{#if item.system.actionPrincipale}} {{item.system.actionPrincipale}} {{/if}} diff --git a/templates/actor/inventaire.html b/templates/actor/inventaire.html index c080c069..ea39f4e8 100644 --- a/templates/actor/inventaire.html +++ b/templates/actor/inventaire.html @@ -20,11 +20,11 @@ {{#each objets as |item id|}} {{#unless item.estContenu}} {{#if (ne item.type 'conteneur')}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/inventaire-item.html" item=item vide=true ouvert=true options=@root.options}} + {{buildLigneInventaire item @root.options}} {{/if}} {{/unless}} {{/each}} {{#each conteneurs as |conteneur id|}} - {{buildConteneur this 'actor/inventaire-item.html' @root.options}} + {{buildLigneInventaire conteneur @root.options}} {{/each}} diff --git a/templates/item-conteneur-sheet.html b/templates/item-conteneur-sheet.html index 033e6f38..5ce7071e 100644 --- a/templates/item-conteneur-sheet.html +++ b/templates/item-conteneur-sheet.html @@ -13,10 +13,8 @@ {{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}} - {{#if isOwned}}
    -
    • Nom @@ -24,7 +22,8 @@ Enc. Actions
    • - {{buildContenu this}} + {{log 'contenu conteneur-sheet' this}} + {{buildInventaireConteneur actorId id @root.options}}
    {{/if}} From 53a7230f1d55ffd81145021c22b7bb58a3027a83 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 28 Jan 2023 16:34:09 +0100 Subject: [PATCH 3/6] Fix: Actions dans un conteneur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les actions dans un conteneur (ouvrir un des sous conteneurs par exemple) n'étaient pas disponibles. Ceci était lié à la structure des données contenant les droits différente pour les items et les acteurs. La gestion des droits était mélangées et faite de façons différentes. Maintenant, les "options" dans les données du formulaire contiennent les informations de droits d'accès et sont utilisées. --- module/actor/base-actor-sheet.js | 18 +---- module/item-sheet.js | 19 +++--- module/item/sheet-service.js | 2 +- module/rdd-alchimie.js | 2 - module/rdd-sheet-utility.js | 19 +++++- templates/actor-creature-sheet.html | 2 +- templates/actor-entite-sheet.html | 2 +- templates/actor-sheet.html | 4 +- templates/actor-vehicule-sheet.html | 2 +- templates/actor/commerce-actor-sheet.html | 2 +- templates/actor/editor-notes-mj.html | 2 +- templates/actor/inventaire-item.html | 28 ++++---- templates/dialog-item-vente.html | 2 +- templates/item-competence-sheet.html | 4 +- templates/item-conteneur-sheet.html | 5 +- templates/item-extraitpoetique-sheet.html | 4 +- templates/item-faune-sheet.html | 2 +- templates/item-livre-sheet.html | 2 +- templates/item-maladie-sheet.html | 8 +-- templates/item-meditation-sheet.html | 2 +- templates/item-poison-sheet.html | 10 +-- templates/item-potion-sheet.html | 2 +- templates/item-queue-sheet.html | 2 +- templates/item-recettealchimique-sheet.html | 8 +-- templates/item-recettecuisine-sheet.html | 2 +- templates/item-rencontre-sheet.html | 66 +++++++++---------- templates/item-sort-sheet.html | 2 +- templates/item-souffle-sheet.html | 2 +- templates/item-tache-sheet.html | 6 +- templates/item/boutons-comestible.html | 2 +- templates/item/partial-environnement.html | 2 +- templates/item/partial-tab-environnement.html | 2 +- templates/partial-item-description.html | 6 +- templates/partial-item-frequence.html | 2 +- templates/partial-item-hautrevant.html | 2 +- 35 files changed, 122 insertions(+), 125 deletions(-) diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index a734f4c7..1af09f3f 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -31,29 +31,18 @@ export class RdDBaseActorSheet extends ActorSheet { Monnaie.validerMonnaies(this.actor.itemTypes['monnaie']); this.actor.recompute(); - const userRightLevel = game.user.isGM ? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER : this.actor.getUserLevel(game.user) - const options = duplicate(this.options); - mergeObject(options, { - isGM: game.user.isGM, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - isLimited: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED, - isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER, - isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER, - owner: this.actor.isOwner, - }); - let formData = { title: this.title, id: this.actor.id, type: this.actor.type, img: this.actor.img, name: this.actor.name, - system: foundry.utils.deepClone(this.actor.system), + system: this.actor.system, description: await TextEditor.enrichHTML(this.actor.system.description, { async: true }), notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }), - options: options, + options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable) } + RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); formData.calc = { fortune: this.toSolsDeniers(this.actor.getFortune()), @@ -64,7 +53,6 @@ export class RdDBaseActorSheet extends ActorSheet { this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs); - return formData; } diff --git a/module/item-sheet.js b/module/item-sheet.js index af48e451..8747e0a3 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -86,22 +86,17 @@ export class RdDItemSheet extends ItemSheet { /* -------------------------------------------- */ async getData() { let formData = { - id: this.item.id, title: this.item.name, + id: this.item.id, type: this.item.type, img: this.item.img, name: this.item.name, system: this.item.system, - isGM: game.user.isGM, actorId: this.actor?.id, - isOwned: this.actor ? true : false, - owner: this.item.isOwner, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - isSoins: false, description: await TextEditor.enrichHTML(this.item.system.description, { async: true }), descriptionmj: await TextEditor.enrichHTML(this.item.system.descriptionmj, { async: true }), - isComestible: this.item.getUtilisationCuisine() + isComestible: this.item.getUtilisationCuisine(), + options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable) } const competences = await SystemCompendiums.getCompetences(this.actor?.type); @@ -138,12 +133,12 @@ export class RdDItemSheet extends ItemSheet { if (this.item.type == 'potion') { await RdDHerbes.addPotionFormData(formData); } - if (formData.isOwned && this.item.type == 'herbe' && (formData.system.categorie == 'Soin' || formData.system.categorie == 'Repos')) { + if (formData.options.isOwned && this.item.type == 'herbe' && (formData.system.categorie == 'Soin' || formData.system.categorie == 'Repos')) { formData.isIngredientPotionBase = true; } if (this.item.type == 'sortreserve') { const sortId = this.item.system.sortid; - formData.sort = formData.isOwned ? this.item.actor.items.get(sortId) : game.items.get(sortId); + formData.sort = formData.options.isOwned ? this.item.actor.items.get(sortId) : game.items.get(sortId); } formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true); @@ -156,7 +151,9 @@ export class RdDItemSheet extends ItemSheet { super.activateListeners(html); this.html = html; - HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned); + HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') + || game.user.isGM + || !this.item.isOwned); HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique()); // Everything below here is only needed if the sheet is editable diff --git a/module/item/sheet-service.js b/module/item/sheet-service.js index a819247d..b9b00146 100644 --- a/module/item/sheet-service.js +++ b/module/item/sheet-service.js @@ -6,7 +6,7 @@ export class RdDServiceItemSheet extends RdDItemSheet { async getData() { const formData = await super.getData(); - formData.disabled = formData.isGM || formData.isOwned ? '' : 'disabled'; + formData.disabled = formData.options.isGM || formData.options.isOwned ? '' : 'disabled'; return formData; } diff --git a/module/rdd-alchimie.js b/module/rdd-alchimie.js index add4bd7c..64605ab4 100644 --- a/module/rdd-alchimie.js +++ b/module/rdd-alchimie.js @@ -8,13 +8,11 @@ export class RdDAlchimie { /* -------------------------------------------- */ static processManipulation(recette, actorId = undefined) { - //console.log("CALLED", recette, recette.isOwned, actorId ); let manip = recette.system.manipulation; let matchArray = manip.match(matchOperations); if (matchArray) { for (let matchStr of matchArray) { let result = matchStr.match(matchOperationTerms); - //console.log("RESULT ", result); if (result[1] && result[2]) { let commande = Misc.upperFirst(result[1]); let replacement = this[`_alchimie${commande}`](recette, result[2], actorId); diff --git a/module/rdd-sheet-utility.js b/module/rdd-sheet-utility.js index e1090a04..da9732cb 100644 --- a/module/rdd-sheet-utility.js +++ b/module/rdd-sheet-utility.js @@ -1,9 +1,24 @@ import { DialogSplitItem } from "./dialog-split-item.js"; import { RdDItem } from "./item.js"; -import { SystemCompendiums } from "./settings/system-compendiums.js"; export class RdDSheetUtility { + static mergeDocumentRights(options, document, editable) { + const userRightLevel = game.user.isGM + ? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER + : document.getUserLevel(game.user); + mergeObject(options, { + isGM: game.user.isGM, + isOwned: document.parent, + editable: editable, + cssClass: editable ? "editable" : "locked", + isLimited: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED, + isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER, + isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER + }); + return options; + } + static getItem(event, actor) { return actor.items.get(RdDSheetUtility.getItemId(event)) } @@ -23,7 +38,7 @@ export class RdDSheetUtility { static async prepareItemDropParameters(destItemId, actor, dragData, objetVersConteneur) { let item = fromUuidSync(dragData.uuid); - if (item.pack && !item.system){ + if (item.pack && !item.system) { item = await RdDItem.getCorrespondingItem(item); } if (actor.canReceive(item)) { diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index 0e93a954..6995640c 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -67,7 +67,7 @@ {{!-- Description Tab --}}
    - {{editor description target="system.description" button=true owner=owner editable=editable engine="prosemirror"}} + {{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    {{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}} diff --git a/templates/actor-entite-sheet.html b/templates/actor-entite-sheet.html index 61cee9d6..5706efde 100644 --- a/templates/actor-entite-sheet.html +++ b/templates/actor-entite-sheet.html @@ -44,7 +44,7 @@
    - {{editor description target="system.description" button=true owner=owner editable=editable engine="prosemirror"}} + {{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    {{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}} diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 9a877b60..de44d86f 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -190,11 +190,11 @@

    Biographie :

    - {{editor biographie target="system.biographie" button=true owner=options.owner editable=true engine="prosemirror"}} + {{editor biographie target="system.biographie" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}

    Notes :

    - {{editor notes target="system.notes" button=true owner=owner editable=true engine="prosemirror"}} + {{editor notes target="system.notes" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    {{> "systems/foundryvtt-reve-de-dragon/templates/actor/xp-journal.html"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}} diff --git a/templates/actor-vehicule-sheet.html b/templates/actor-vehicule-sheet.html index fe9dcf88..ea6527f4 100644 --- a/templates/actor-vehicule-sheet.html +++ b/templates/actor-vehicule-sheet.html @@ -84,7 +84,7 @@
    - {{editor description target="system.description" button=true owner=owner editable=true engine="prosemirror"}} + {{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    {{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}} diff --git a/templates/actor/commerce-actor-sheet.html b/templates/actor/commerce-actor-sheet.html index 9bff7277..ae98e7bc 100644 --- a/templates/actor/commerce-actor-sheet.html +++ b/templates/actor/commerce-actor-sheet.html @@ -36,7 +36,7 @@ {{!-- Sheet Body --}}
    - {{editor description target="system.description" button=true owner=options.owner editable=options.isOwner engine="prosemirror"}} + {{editor description target="system.description" button=true owner=options.isOwner editable=options.isOwner engine="prosemirror"}}

    {{> "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.html"}} diff --git a/templates/actor/editor-notes-mj.html b/templates/actor/editor-notes-mj.html index c34e91b8..32c17a6e 100644 --- a/templates/actor/editor-notes-mj.html +++ b/templates/actor/editor-notes-mj.html @@ -1,6 +1,6 @@ {{#if options.isGM}}

    Notes du MJ :

    - {{editor notesmj target="system.notesmj" button=true owner=owner editable=true engine="prosemirror"}} + {{editor notesmj target="system.notesmj" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    {{/if}} diff --git a/templates/actor/inventaire-item.html b/templates/actor/inventaire-item.html index 25e5984b..a89f0716 100644 --- a/templates/actor/inventaire-item.html +++ b/templates/actor/inventaire-item.html @@ -22,23 +22,23 @@ {{numberFormat item.system.encTotal decimals=2}} {{#if options.isOwner}} - {{#unless item.estContenu}} - {{#if (or (eq item.type 'arme') (eq item.type 'armure') )}} - {{#if item.system.equipe}}{{else}}{{/if}} - {{/if}} - {{/unless}} - - -   - {{#if (ne item.system.quantite 0)}} - - {{/if}} + {{#unless item.estContenu}} + {{#if (or (eq item.type 'arme') (eq item.type 'armure') )}} + {{#if item.system.equipe}}{{else}}{{/if}} + {{/if}} + {{/unless}} + + +   + {{#if (ne item.system.quantite 0)}} + + {{/if}} {{/if}} {{#if options.isOwner}} - {{#if item.system.actionPrincipale}} - {{item.system.actionPrincipale}} - {{/if}} + {{#if item.system.actionPrincipale}} + {{item.system.actionPrincipale}} + {{/if}} {{/if}}
  • diff --git a/templates/dialog-item-vente.html b/templates/dialog-item-vente.html index 1307b33a..0a2b4313 100644 --- a/templates/dialog-item-vente.html +++ b/templates/dialog-item-vente.html @@ -13,7 +13,7 @@
    - {{#unless isOwned}} + {{#unless options.isOwned}} diff --git a/templates/item-competence-sheet.html b/templates/item-competence-sheet.html index 78a7a780..d0287462 100644 --- a/templates/item-competence-sheet.html +++ b/templates/item-competence-sheet.html @@ -3,7 +3,7 @@

    - {{#if isGM}} + {{#if options.isGM}} {{else}} {{item.name}} @@ -32,7 +32,7 @@

    - {{#if isGM}} + {{#if options.isGM}}
    {{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}} - {{#if isOwned}} + {{#if options.isOwned}}
    • @@ -22,8 +22,7 @@ Enc. Actions
    • - {{log 'contenu conteneur-sheet' this}} - {{buildInventaireConteneur actorId id @root.options}} + {{buildInventaireConteneur actorId id options}}
    {{/if}} diff --git a/templates/item-extraitpoetique-sheet.html b/templates/item-extraitpoetique-sheet.html index a02127c0..5c0414b5 100644 --- a/templates/item-extraitpoetique-sheet.html +++ b/templates/item-extraitpoetique-sheet.html @@ -12,13 +12,13 @@
    - {{editor extrait target="system.extrait" button=true owner=owner editable=true engine="prosemirror"}} + {{editor extrait target="system.extrait" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    - {{editor texte target="system.texte" button=true owner=owner editable=true engine="prosemirror"}} + {{editor texte target="system.texte" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
    diff --git a/templates/item-faune-sheet.html b/templates/item-faune-sheet.html index cde0c58c..2970fc02 100644 --- a/templates/item-faune-sheet.html +++ b/templates/item-faune-sheet.html @@ -29,7 +29,7 @@
    {{#if system.actor.id}} - {{#if isGM}} + {{#if options.isGM}}