From aa52e26e1ad76285b03233b087d87397c05d6b84 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 8 Jan 2025 23:51:11 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20pas=20de=20message=20si=20carac=20ex?= =?UTF-8?q?acte=20pas=20trouv=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La recherche se fait en deux temps, on avait un message d'erreur pour odorat-gout --- module/actor/base-actor.js | 2 +- module/misc.js | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/module/actor/base-actor.js b/module/actor/base-actor.js index a10be819..544dd711 100644 --- a/module/actor/base-actor.js +++ b/module/actor/base-actor.js @@ -21,7 +21,7 @@ export class RdDBaseActor extends Actor { static $findCaracByName(carac, name) { const caracList = Object.entries(carac); - let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' }); + let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique', onMessage: m => { } }); if (!entry || entry.length == 0) { entry = Misc.findFirstLike(name, caracList, { mapper: it => it[1].label, description: 'caractéristique' }); } diff --git a/module/misc.js b/module/misc.js index ed0dd0b6..40afa4d5 100644 --- a/module/misc.js +++ b/module/misc.js @@ -1,5 +1,12 @@ import { Grammar } from "./grammar.js"; +const DEFAULT_FIND_OPTIONS = { + mapper: it => it.name, + preFilter: it => true, + description: 'valeur', + onMessage: m => ui.notifications.info(m) +} + /** * This class is intended as a placeholder for utility methods unrelated * to actual classes of the game system or of FoundryVTT @@ -226,13 +233,7 @@ export class Misc { /* -------------------------------------------- */ static findFirstLike(value, elements, options = {}) { - options = foundry.utils.mergeObject({ - mapper: it => it.name, - preFilter: it => true, - description: 'valeur', - onMessage: m => ui.notifications.info(m) - }, options, { overwrite: true, inplace: false }); - + options = foundry.utils.mergeObject(DEFAULT_FIND_OPTIONS, options, { overwrite: true, inplace: false }); const subset = this.findAllLike(value, elements, options); if (subset.length == 0) { console.log(`Aucune ${options.description} pour ${value}`); @@ -251,13 +252,7 @@ export class Misc { } static findAllLike(value, elements, options = {}) { - options = foundry.utils.mergeObject({ - mapper: it => it.name, - preFilter: it => true, - description: 'valeur', - onMessage: m => ui.notifications.info(m) - }, options); - + options = foundry.utils.mergeObject(DEFAULT_FIND_OPTIONS, options, { overwrite: true, inplace: false }); if (!value) { options.onMessage(`Pas de ${options.description} correspondant à une valeur vide`); return []; From daca86b1df834fb4a842c2b48f128c43c9cebe1c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 10 Jan 2025 19:37:34 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20experience=20sur=20particuli=C3=A8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 4 ++++ module/actor.js | 2 +- module/misc.js | 4 ++++ system.json | 6 +++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 48c09cdd..fc9a85ac 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,8 @@ # 12.0 +## 12.0.33 - la vieillesse d'Astrobazzarh +- retour de l'expérience pour les joueurs +- suppression du message "Pas de caractéristique" sur les jets d'odorat-goût + ## 12.0.32 - les rêveries d'Astrobazzarh - Ajout des Items Race pour gérer les ajustements liés aux races diff --git a/module/actor.js b/module/actor.js index b0e3c09a..76c5d3b6 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1596,7 +1596,7 @@ export class RdDActor extends RdDBaseActorSang { /* -------------------------------------------- */ async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { - if (!Misc.isFirstConnectedGM()) { + if (!Misc.hasConnectedGM()) { return } hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM) diff --git a/module/misc.js b/module/misc.js index 40afa4d5..72530790 100644 --- a/module/misc.js +++ b/module/misc.js @@ -216,6 +216,10 @@ export class Misc { static isFirstConnectedGM() { return game.user == Misc.firstConnectedGM(); } + + static hasConnectedGM() { + return Misc.firstConnectedGM(); + } static firstConnectedGMId() { return Misc.firstConnectedGM()?.id; diff --git a/system.json b/system.json index 9025016d..ae6483e6 100644 --- a/system.json +++ b/system.json @@ -1,9 +1,9 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "12.0.32", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.32/rddsystem.zip", - "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.32/system.json", + "version": "12.0.33", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.33/rddsystem.zip", + "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/12.0.33/system.json", "changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md", "compatibility": { "minimum": "11",