From 9aad57c00c42d0a824c2a5f4d8435fa3418bc93b Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 3 Jun 2022 01:30:36 +0200 Subject: [PATCH 01/10] =?UTF-8?q?Fix=20Nom=20des=20TMR=20d=C3=A9solation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Il n'y a pas que la désolation de Demain Change-Id: I41cef0204edae57d6071c8b3b33f0dd63a42c2a5 --- module/tmr-utility.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/module/tmr-utility.js b/module/tmr-utility.js index cebf8e83..81829b71 100644 --- a/module/tmr-utility.js +++ b/module/tmr-utility.js @@ -2,7 +2,6 @@ import { TMRRencontres } from "./tmr-rencontres.js"; import { Misc } from "./misc.js"; import { Grammar } from "./grammar.js"; import { RdDDice } from "./rdd-dice.js"; -import { tmrConstants } from "./tmr-constants.js"; /* -------------------------------------------- */ const TMRMapping = { @@ -12,7 +11,7 @@ const TMRMapping = { D1: { type: "fleuve", label: "Fleuve de l'Oubli" }, E1: { type: "monts", label: "Monts de Kanaï" }, F1: { type: "cite", label: "Cité Glauque" }, - G1: { type: "desolation", label: "Désolation de Demain" }, + G1: { type: "desolation", label: "Désolation de Jamais" }, H1: { type: "lac", label: "Lac d’Anticalme" }, I1: { type: "plaines", label: "Plaines Grises" }, J1: { type: "monts", label: "Monts Fainéants" }, @@ -70,7 +69,7 @@ const TMRMapping = { F5: { type: "cite", label: "Cité de Panople" }, G5: { type: "pont", label: "Pont d’Ik" }, H5: { type: "desert", label: "Désert de Krane" }, - I5: { type: "desolation", label: "Désolation de Demain" }, + I5: { type: "desolation", label: "Désolation de Toujours" }, J5: { type: "marais", label: "Marais de Jab" }, K5: { type: "fleuve", label: "Fleuve de l'Oubli" }, L5: { type: "collines", label: "Collines Suaves" }, @@ -86,9 +85,9 @@ const TMRMapping = { H6: { type: "monts", label: "Monts Gurdes" }, I6: { type: "necropole", label: "Nécropole de Xotar" }, J6: { type: "lac", label: "Lac d’Iaupe" }, - K6: { type: "desolation", label: "Désolation de Demain" }, + K6: { type: "desolation", label: "Désolation de Poor" }, L6: { type: "foret", label: "Forêt Gueuse" }, - M6: { type: "desolation", label: "Désolation de Demain" }, + M6: { type: "desolation", label: "Désolation de Presque" }, A7: { type: "plaines", label: "Plaines de l’Arc" }, B7: { type: "marais", label: "Marais Bluants" }, @@ -124,7 +123,7 @@ const TMRMapping = { D9: { type: "pont", label: "Pont d’Orx" }, E9: { type: "fleuve", label: "Fleuve de l'Oubli" }, F9: { type: "plaines", label: "Plaines de Foe" }, - G9: { type: "desolation", label: "Désolation de Demain" }, + G9: { type: "desolation", label: "Désolation de Sel" }, H9: { type: "collines", label: "Collines de Noirseul" }, I9: { type: "fleuve", label: "Fleuve de l'Oubli" }, J9: { type: "marais", label: "Marais Gronchants" }, @@ -146,10 +145,10 @@ const TMRMapping = { L10: { type: "desert", label: "Désert de Nicrop" }, M10: { type: "foret", label: "Forêt de Jajou" }, - A11: { type: "desolation", label: "Désolation de Demain" }, + A11: { type: "desolation", label: "Désolation d’Hier" }, B11: { type: "cite", label: "Cité de Brilz" }, C11: { type: "pont", label: "Pont de Roï" }, - D11: { type: "desolation", label: "Désolation de Demain" }, + D11: { type: "desolation", label: "Désolation de Partout" }, E11: { type: "lac", label: "Lac de Glinster" }, F11: { type: "cite", label: "Cité de Noape" }, G11: { type: "fleuve", label: "Fleuve de l'Oubli" }, @@ -170,7 +169,7 @@ const TMRMapping = { H12: { type: "collines", label: "Collines de Tooth" }, I12: { type: "gouffre", label: "Gouffre Abimeux" }, J12: { type: "cite", label: "Cité Folle" }, - K12: { type: "desolation", label: "Désolation de Demain" }, + K12: { type: "desolation", label: "Désolation d’Amour" }, L12: { type: "plaines", label: "Plaines Venteuses" }, M12: { type: "collines", label: "Collines Révulsantes" }, @@ -181,7 +180,7 @@ const TMRMapping = { E13: { type: "plaines", label: "Plaines de Xnez" }, F13: { type: "foret", label: "Forêt des Cris" }, G13: { type: "plaines", label: "Plaines Calcaires" }, - H13: { type: "desolation", label: "Désolation de Demain" }, + H13: { type: "desolation", label: "Désolation de Rien" }, I13: { type: "monts", label: "Monts Bigleux" }, J13: { type: "gouffre", label: "Gouffre de Gromph" }, K13: { type: "foret", label: "Forêt de Kluth" }, @@ -200,8 +199,8 @@ const TMRMapping = { J14: { type: "desert", label: "Désert de Sank" }, K14: { type: "necropole", label: "Nécropole d’Antinéar" }, L14: { type: "plaines", label: "Plaines de Jislith" }, - M14: { type: "desolation", label: "Désolation de Demain" }, - + M14: { type: "desolation", label: "Désolation d’Après" }, + A15: { type: "cite", label: "Cité de Mielh" }, C15: { type: "plaines", label: "Plaines de Toué" }, E15: { type: "foret", label: "Forêt des Furies" }, From 66218be14acee8d977f15a9e10352f5a8c593ccd Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 3 Jun 2022 09:11:28 +0200 Subject: [PATCH 02/10] Fix TMR --- system.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system.json b/system.json index 698a7e13..ece7cfbb 100644 --- a/system.json +++ b/system.json @@ -29,7 +29,7 @@ "url": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/", "license": "LICENSE.txt", "flags": {}, - "version": "1.5.76", + "version": "1.5.77", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "9", "scripts": [], @@ -500,7 +500,7 @@ "dependencies": [], "socket": true, "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v1.5/system.json", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-1.5.76.zip", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-1.5.77.zip", "protected": false, "gridDistance": 1, "gridUnits": "m", From bdead49d01f36de94f524e1e9928f04b40a20001 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 4 Jun 2022 23:17:27 +0200 Subject: [PATCH 03/10] Renommage methode checkNull --- module/actor-entite-sheet.js | 7 ---- module/actor-vehicule-sheet.js | 8 ----- module/rdd-utility.js | 64 +++++++++++++++++----------------- 3 files changed, 32 insertions(+), 47 deletions(-) diff --git a/module/actor-entite-sheet.js b/module/actor-entite-sheet.js index eabaf828..ce0d51a2 100644 --- a/module/actor-entite-sheet.js +++ b/module/actor-entite-sheet.js @@ -22,13 +22,6 @@ export class RdDActorEntiteSheet extends ActorSheet { }); } - /* -------------------------------------------- */ - _checkNull(items) { - if (items && items.length) { - return items; - } - return []; - } /* -------------------------------------------- */ async getData() { diff --git a/module/actor-vehicule-sheet.js b/module/actor-vehicule-sheet.js index 43b20810..e6cf1fbc 100644 --- a/module/actor-vehicule-sheet.js +++ b/module/actor-vehicule-sheet.js @@ -25,14 +25,6 @@ export class RdDActorVehiculeSheet extends ActorSheet { }); } - /* -------------------------------------------- */ - _checkNull(items) { - if (items && items.length) { - return items; - } - return []; - } - /* -------------------------------------------- */ async getData() { const objectData = Misc.data(this.object); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 1c43cdc8..786ad9b1 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -326,8 +326,8 @@ export class RdDUtility { } /* -------------------------------------------- */ - static checkNull(items) { - if (items && items.length) { + static arrayOrEmpty(items) { + if (items?.length) { return items; } return []; @@ -360,44 +360,44 @@ export class RdDUtility { RdDUtility.filterEquipementParType(formData); - formData.sorts = this.checkNull(formData.itemsByType['sort']); - formData.signesdraconiques = this.checkNull(formData.itemsByType['signedraconique']); - formData.queues = this.checkNull(formData.itemsByType['queue']); - formData.souffles = this.checkNull(formData.itemsByType['souffle']); - formData.ombres = this.checkNull(formData.itemsByType['ombre']); - formData.tetes = this.checkNull(formData.itemsByType['tete']); - formData.taches = this.checkNull(formData.itemsByType['tache']); - formData.meditations = this.checkNull(formData.itemsByType['meditation']); - formData.chants = this.checkNull(formData.itemsByType['chant']); - formData.danses = this.checkNull(formData.itemsByType['danse']); - formData.musiques = this.checkNull(formData.itemsByType['musique']); - formData.oeuvres = this.checkNull(formData.itemsByType['oeuvre']); - formData.jeux = this.checkNull(formData.itemsByType['jeu']); + formData.sorts = this.arrayOrEmpty(formData.itemsByType['sort']); + formData.signesdraconiques = this.arrayOrEmpty(formData.itemsByType['signedraconique']); + formData.queues = this.arrayOrEmpty(formData.itemsByType['queue']); + formData.souffles = this.arrayOrEmpty(formData.itemsByType['souffle']); + formData.ombres = this.arrayOrEmpty(formData.itemsByType['ombre']); + formData.tetes = this.arrayOrEmpty(formData.itemsByType['tete']); + formData.taches = this.arrayOrEmpty(formData.itemsByType['tache']); + formData.meditations = this.arrayOrEmpty(formData.itemsByType['meditation']); + formData.chants = this.arrayOrEmpty(formData.itemsByType['chant']); + formData.danses = this.arrayOrEmpty(formData.itemsByType['danse']); + formData.musiques = this.arrayOrEmpty(formData.itemsByType['musique']); + formData.oeuvres = this.arrayOrEmpty(formData.itemsByType['oeuvre']); + formData.jeux = this.arrayOrEmpty(formData.itemsByType['jeu']); - formData.recettescuisine = this.checkNull(formData.itemsByType['recettecuisine']); - formData.recettesAlchimiques = this.checkNull(formData.itemsByType['recettealchimique']); - formData.maladies = this.checkNull(formData.itemsByType['maladie']); - formData.poisons = this.checkNull(formData.itemsByType['poison']); - formData.possessions = this.checkNull(formData.itemsByType['possession']); + formData.recettescuisine = this.arrayOrEmpty(formData.itemsByType['recettecuisine']); + formData.recettesAlchimiques = this.arrayOrEmpty(formData.itemsByType['recettealchimique']); + formData.maladies = this.arrayOrEmpty(formData.itemsByType['maladie']); + formData.poisons = this.arrayOrEmpty(formData.itemsByType['poison']); + formData.possessions = this.arrayOrEmpty(formData.itemsByType['possession']); formData.maladiesPoisons = formData.maladies.concat(formData.poisons); formData.competences = (formData.itemsByType.competence ?? []).concat(formData.itemsByType.competencecreature ?? []); } static filterEquipementParType(formData) { - formData.conteneurs = this.checkNull(formData.itemsByType['conteneur']); + formData.conteneurs = this.arrayOrEmpty(formData.itemsByType['conteneur']); - formData.materiel = this.checkNull(formData.itemsByType['objet']); - formData.armes = this.checkNull(formData.itemsByType['arme']); - formData.armures = this.checkNull(formData.itemsByType['armure']); - formData.munitions = this.checkNull(formData.itemsByType['munition']); - formData.livres = this.checkNull(formData.itemsByType['livre']); - formData.potions = this.checkNull(formData.itemsByType['potion']); - formData.ingredients = this.checkNull(formData.itemsByType['ingredient']); - formData.herbes = this.checkNull(formData.itemsByType['herbe']); - formData.monnaie = this.checkNull(formData.itemsByType['monnaie']); + formData.materiel = this.arrayOrEmpty(formData.itemsByType['objet']); + formData.armes = this.arrayOrEmpty(formData.itemsByType['arme']); + formData.armures = this.arrayOrEmpty(formData.itemsByType['armure']); + formData.munitions = this.arrayOrEmpty(formData.itemsByType['munition']); + formData.livres = this.arrayOrEmpty(formData.itemsByType['livre']); + formData.potions = this.arrayOrEmpty(formData.itemsByType['potion']); + formData.ingredients = this.arrayOrEmpty(formData.itemsByType['ingredient']); + formData.herbes = this.arrayOrEmpty(formData.itemsByType['herbe']); + formData.monnaie = this.arrayOrEmpty(formData.itemsByType['monnaie']); formData.monnaie.sort(Monnaie.triValeurDenier()); - formData.nourritureboissons = this.checkNull(formData.itemsByType['nourritureboisson']); - formData.gemmes = this.checkNull(formData.itemsByType['gemme']); + formData.nourritureboissons = this.arrayOrEmpty(formData.itemsByType['nourritureboisson']); + formData.gemmes = this.arrayOrEmpty(formData.itemsByType['gemme']); formData.objets = formData.conteneurs .concat(formData.materiel) From 70354abacb42652dec0b918a0c7a7f48dd1df100 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 4 Jun 2022 23:22:48 +0200 Subject: [PATCH 04/10] Fix XP en sort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cas d'xp en sort concaténée --- module/item-signedraconique.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/item-signedraconique.js b/module/item-signedraconique.js index 6e6e75c0..e93dc9df 100644 --- a/module/item-signedraconique.js +++ b/module/item-signedraconique.js @@ -44,7 +44,7 @@ export class RdDItemSigneDraconique { } static getXpSortSigneDraconique(code, signe) { - return Misc.data(signe).data.valeur[code] ?? 0; + return Misc.toInt(Misc.data(signe).data.valeur[code] ?? 0); } static calculValeursXpSort(qualite, valeur, avant) { From 3a684c3c54b1d8404dabb16d07c21acf2be2aaa5 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 4 Jun 2022 23:23:07 +0200 Subject: [PATCH 05/10] Fix typo resaon --- module/tmr/pixi-tmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/tmr/pixi-tmr.js b/module/tmr/pixi-tmr.js index 368e0e00..a5f6cbbe 100644 --- a/module/tmr/pixi-tmr.js +++ b/module/tmr/pixi-tmr.js @@ -25,7 +25,7 @@ export class PixiTMR { for (const [name, img] of Object.entries(PixiTMR.textures)) { loader = loader.add(name, img); } - loader.onLoad.add((error, resaon) => { console.log("ERROR", error, resaon) }); + loader.onLoad.add((error, reason) => { console.log("ERROR", error, reason) }); loader.load( (loader, resources) => { onLoad(loader, resources); for (let onAnimate of this.callbacksOnAnimate) { From 75562b0af89674f6111f0a40aa821b096d6ac119 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 4 Jun 2022 23:23:29 +0200 Subject: [PATCH 06/10] Suppressions de logs --- templates/actor-creature-sheet.html | 1 - templates/dialog-roll-signedraconique.html | 1 - 2 files changed, 2 deletions(-) diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index 0556d602..b9d3e4d0 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -55,7 +55,6 @@ {{/each}}
  • Total Caractéristiques - {{log 'data-actor-creature' this}} {{calc.caracTotal}}
  • diff --git a/templates/dialog-roll-signedraconique.html b/templates/dialog-roll-signedraconique.html index bf8fd8b2..051341ec 100644 --- a/templates/dialog-roll-signedraconique.html +++ b/templates/dialog-roll-signedraconique.html @@ -1,4 +1,3 @@ -{{log 'lecture signe draconique' this}}

    Lire le signe draconique