From d7e54aeb4f3c7214b4d8b39529019c302ff280af Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Thu, 25 May 2023 14:55:31 +0200 Subject: [PATCH] Initial commit for v11 support --- babele-register.js | 3 ++- module.json | 15 +++------------ modules/config-patch.js | 42 ++++++++++++++++++++++++++--------------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/babele-register.js b/babele-register.js index 8d8a196..9866145 100644 --- a/babele-register.js +++ b/babele-register.js @@ -571,7 +571,8 @@ function registerUsageCount(registerKey) { /*---------------------------------------------------------------------*/ Hooks.once('ready', () => { - + registerUsageCount("wh4-fr-translation") + }); \ No newline at end of file diff --git a/module.json b/module.json index 59fe76b..fe4dc69 100644 --- a/module.json +++ b/module.json @@ -8,7 +8,7 @@ } ], "url": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr", - "version": "6.5.0", + "version": "6.5.3", "esmodules": [ "babele-register.js", "addon-register.js", @@ -44,15 +44,6 @@ "private": false, "flags": {} }, - { - "label": "Carrières FR", - "type": "Item", - "name": "carriere-fr", - "path": "packs/carriere-fr.db", - "system": "wfrp4e", - "private": false, - "flags": {} - }, { "label": "Sorts FR", "type": "Item", @@ -136,12 +127,12 @@ } ], "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/raw/v10/module.json", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/archive/foundryvtt-wh4-lang-fr-6.5.0.zip", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/archive/foundryvtt-wh4-lang-fr-6.5.3.zip", "id": "wh4-fr-translation", "compatibility": { "minimum": "10", "verified": "10", - "maximum": "10" + "maximum": "11" }, "relationships": { "systems": [ diff --git a/modules/config-patch.js b/modules/config-patch.js index 8666d77..19cc6ed 100644 --- a/modules/config-patch.js +++ b/modules/config-patch.js @@ -112,6 +112,14 @@ export class WH4FRPatchConfig { /************************************************************************************/ static perform_patch() { + if (game.user.isGM) { + let coreC7 = game.modules.find(mod => mod.id == "wfrp4e-core") + if (!coreC7 || !coreC7.active) { + ui.notifications.warn("Vous n'avez pas activé le module CoreC7 ! La traduction sera donc incomplète et inopérante.") + return + } + } + // Detect and patch as necessary if (game.wfrp4e.config && game.wfrp4e.config.talentBonuses && game.wfrp4e.config.talentBonuses["vivacité"] == undefined) { console.log("Patching WFRP4E now ...."); @@ -130,22 +138,26 @@ export class WH4FRPatchConfig { "guerrier né": "ws" } - game.wfrp4e.config.loreEffects["beasts"].label = "Domaine des Bêtes" - game.wfrp4e.config.loreEffects["death"].label = "Domaine de la Mort" - game.wfrp4e.config.loreEffects["fire"].label = "Domaine du Feu" - game.wfrp4e.config.loreEffects["metal"].label = "Domaine du Métal" - game.wfrp4e.config.loreEffects["heavens"].label = "Domaine des Cieux" - game.wfrp4e.config.loreEffects["life"].label = "Domaine de la Vie" - game.wfrp4e.config.loreEffects["light"].label = "Domaine de la Lumière" - game.wfrp4e.config.loreEffects["shadow"].label = "Domaine des Ombres" - game.wfrp4e.config.loreEffects["hedgecraft"].label = "Domaine de la Magie de Village" - game.wfrp4e.config.loreEffects["hedgecraft"].label = "Domaine de la Sorcellerie" + if (game.wfrp4e.config.loreEffects) { + game.wfrp4e.config.loreEffects["beasts"].label = "Domaine des Bêtes" + game.wfrp4e.config.loreEffects["death"].label = "Domaine de la Mort" + game.wfrp4e.config.loreEffects["fire"].label = "Domaine du Feu" + game.wfrp4e.config.loreEffects["metal"].label = "Domaine du Métal" + game.wfrp4e.config.loreEffects["heavens"].label = "Domaine des Cieux" + game.wfrp4e.config.loreEffects["life"].label = "Domaine de la Vie" + game.wfrp4e.config.loreEffects["light"].label = "Domaine de la Lumière" + game.wfrp4e.config.loreEffects["shadow"].label = "Domaine des Ombres" + game.wfrp4e.config.loreEffects["hedgecraft"].label = "Domaine de la Magie de Village" + game.wfrp4e.config.loreEffects["hedgecraft"].label = "Domaine de la Sorcellerie" + } - game.wfrp4e.config.species["human"] = "Humain"; - game.wfrp4e.config.species["dwarf"] = "Nain"; - game.wfrp4e.config.species["halfling"] = "Halfling"; - game.wfrp4e.config.species["helf"] = "Haut Elfe"; - game.wfrp4e.config.species["welf"] = "Elfe Sylvain"; + if (game.wfrp4e.config.species) { + game.wfrp4e.config.species["human"] = "Humain"; + game.wfrp4e.config.species["dwarf"] = "Nain"; + game.wfrp4e.config.species["halfling"] = "Halfling"; + game.wfrp4e.config.species["helf"] = "Haut Elfe"; + game.wfrp4e.config.species["welf"] = "Elfe Sylvain"; + } this.patch_species_skills(); this.patch_species_talents();