diff --git a/module.json b/module.json index 1674c21..4b09679 100644 --- a/module.json +++ b/module.json @@ -8,7 +8,7 @@ } ], "url": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr", - "version": "8.2.0", + "version": "8.2.1", "esmodules": [ "modules/babele-register.js", "modules/addon-register.js", @@ -117,7 +117,7 @@ } ], "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-8.2.0.zip", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/archive/foundryvtt-wh4-lang-fr-8.2.1.zip", "id": "wh4-fr-translation", "compatibility": { "minimum": "12", diff --git a/modules/addon-register.js b/modules/addon-register.js index e8f61df..a4a52d4 100644 --- a/modules/addon-register.js +++ b/modules/addon-register.js @@ -257,7 +257,7 @@ const __check_fix_wrong_modules = (chatFlag, patchFinished) => { }); if (game.user.isGM && patchFinished) { ChatMessage.create({ - content: "
Les modules WFRP4E ont été patchés avec succés. Vous pouvez y aller et que Shallya vous garde !
Derniers changements : correction pour acteurs de RNHD et ajout des traductions des items de Aventures à Ubesreik 1 (François Cheminade)
", + content: "
Les modules WFRP4E ont été patchés avec succés. Vous pouvez y aller et que Shallya vous garde !
Derniers changements : Support wfrp4 v8.X, import de personnage OK
", user: game.user.id, whisper: ChatMessage.getWhisperRecipients("GM") }); diff --git a/modules/babele-register.js b/modules/babele-register.js index c87d325..004ec3f 100644 --- a/modules/babele-register.js +++ b/modules/babele-register.js @@ -364,7 +364,7 @@ Hooks.once('init', () => { let s1 = res[1].trim(); // No () in talents table translItem = game.babele.translate(compData.metadata.id, { name: s1 }, true) let translw = translItem?.name || undefined - console.log("Search talent name:", compData.metadata.id, s1, translw); + //console.log("Search talent name:", compData.metadata.id, s1, translw); if (translw && translw != s1) { transl = translw + " (" + subword + ")"; } diff --git a/modules/import-stat-2.js b/modules/import-stat-2.js index 3bfa230..377aa15 100644 --- a/modules/import-stat-2.js +++ b/modules/import-stat-2.js @@ -1,18 +1,8 @@ /************************************************************************************/ // Some internal test strings let strfr = `LA TERREUR DE LA TEUFEL, TROLL DE RIVIÈRE RUSÉ -M - CC CT - F - E - I - Ag Dex Int FM Soc B -4 - 40 15 - 55 - 45 - 20 - 15 15 30 20 5 38 +M CC CT F E I Ag Dex Int FM Soc B +4 40 15 55 45 20 15 15 30 20 5 38 Traits : Amphibie, Arme +9, Armure (2), Dur à Cuire, Insensible à la douleur, Morsure +8, Régénération, Taille (Grande), Vision Nocturne, Vomissement` @@ -52,7 +42,7 @@ import "./xregexp-all.js"; const us_carac = 'm\\s+ws\\s+bs\\s+s\\s+t\\s+i\\s+agi?\\s+dex\\s+int\\s+\\wp\\s+fel\\s+w'; const fr_carac = 'm\\s+cc\\s+ct\\s+f\\s+e\\s+i\\s+agi?\\s+dex\\s+int\\s+fm\\s+soc\\s+b'; const carac_val = '(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-]+)\\s+(?[0-9\\-\*]+)'; -const name_val = '(?[a-zA-Z\\s\\-,\']*)[\\s\\r\\na-zA-Z]*(?.*|[\\(\\)a-z0-9]+)'; +const name_val = '(?[a-zA-Zéèêâôïäüù\\s\\-,\']*)[\\s\\r\\na-zA-Zéèêâôïäüù]*(?.*|[\\(\\)a-z0-9]+)'; let sectionDataFR = [ { name: "trait", toFind: "Traits\\s*:", secondParse: '(?[a-zöàéè\\s]*)[\\s\\+]*(?.*|[\\+0-9]+)', index: -1 }, { name: "skill", toFind: "Compétences\\s*:", secondParse: '(?[a-zàéè\\s\\(\\)]*)[\\s\\+]*(?.*|[0-9]+)', index: -1 }, @@ -246,7 +236,7 @@ function __patchName(name) { /************************************************************************************/ export default async function statParserFR(statString, type = "npc") { - let model = foundry.utils.duplicate(game.system.model.Actor[type]); + let model = foundry.utils.duplicate(game.model.Actor[type]); // Patch wront/strange carac value before processing statString = statString.replace(/ –/g, " 0") @@ -308,14 +298,14 @@ export default async function statParserFR(statString, type = "npc") { let resCarac = XRegExp.exec(statString, reg2) // resr contains all carac found // Setup carac - //console.log("CARAC", resCarac) + console.log("CARAC", resCarac) if (resCarac["Agi"]) resCarac["Ag"] = resCarac["Agi"] // Auto patch model.details.move.value = Number(resCarac["m"]) for (let key in model.characteristics) { if (resCarac[key] === '-') resCarac[key] = 0 model.characteristics[key].initial = Number(resCarac[key]) } - //console.log("CARAC", model.characteristics); + console.log("CARAC", model.characteristics); // Search position of skills/talents/... for (let def of sectionData) { @@ -424,11 +414,11 @@ export default async function statParserFR(statString, type = "npc") { } if (!itemFound && name) { if (name.toLowerCase().includes("armor") || name.toLowerCase().includes("armure") || name.toLowerCase().includes("armour")) { - itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name, type: "armour", system: game.system.model.Item.armor }) + itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name, type: "armour", system: game.model.Item.armour }) } else if (name.toLowerCase().includes("weapon") || name.toLowerCase().includes("arme")) { - itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name, type: "weapon", system: game.system.model.Item.weapon }) + itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name, type: "weapon", system: game.model.Item.weapon }) } else { - itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name, type: "trapping", system: game.system.model.Item.trapping }) + itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name, type: "trapping", system: game.model.Item.trapping }) itemFound.system.trappingType.value = "misc" if (name.toLowerCase().includes("cloth")) { itemFound.system.trappingType.value = "clothingAccessories" @@ -457,7 +447,7 @@ export default async function statParserFR(statString, type = "npc") { itemFound = await __findItem(name, "spell"); } if (!itemFound && name) { // Auto-create the spell name - itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name + "(To be checked/completed)", type: "spell", system: game.system.model.Item.spell }) + itemFound = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: name + "(To be checked/completed)", type: "spell", system: game.model.Item.spell }) itemFound = itemFound.toObject(); } } else if (def.name == 'mutation') { @@ -507,7 +497,7 @@ export default async function statParserFR(statString, type = "npc") { } //DEBUG : console.log("EFFECTS", effects) - return { name, type, data: model, items: globalItemList, effects } + return { name, type, system: model, items: globalItemList, effects } } // If the carac string has not been found diff --git a/packs/aides-de-jeu-fr/000858.log b/packs/aides-de-jeu-fr/000870.log similarity index 100% rename from packs/aides-de-jeu-fr/000858.log rename to packs/aides-de-jeu-fr/000870.log diff --git a/packs/aides-de-jeu-fr/MANIFEST-000856 b/packs/aides-de-jeu-fr/MANIFEST-000856 deleted file mode 100644 index 828380d..0000000 Binary files a/packs/aides-de-jeu-fr/MANIFEST-000856 and /dev/null differ diff --git a/packs/antidotes-and-remedes/000860.log b/packs/antidotes-and-remedes/000872.log similarity index 100% rename from packs/antidotes-and-remedes/000860.log rename to packs/antidotes-and-remedes/000872.log diff --git a/packs/antidotes-and-remedes/MANIFEST-000858 b/packs/antidotes-and-remedes/MANIFEST-000858 deleted file mode 100644 index 336492c..0000000 Binary files a/packs/antidotes-and-remedes/MANIFEST-000858 and /dev/null differ diff --git a/packs/apothicarium/000858.log b/packs/apothicarium/000870.log similarity index 100% rename from packs/apothicarium/000858.log rename to packs/apothicarium/000870.log diff --git a/packs/apothicarium/MANIFEST-000856 b/packs/apothicarium/MANIFEST-000856 deleted file mode 100644 index 3725bad..0000000 Binary files a/packs/apothicarium/MANIFEST-000856 and /dev/null differ diff --git a/packs/dons-de-rhya/000858.log b/packs/dons-de-rhya/000870.log similarity index 100% rename from packs/dons-de-rhya/000858.log rename to packs/dons-de-rhya/000870.log diff --git a/packs/dons-de-rhya/MANIFEST-000856 b/packs/dons-de-rhya/MANIFEST-000856 deleted file mode 100644 index a5b414f..0000000 Binary files a/packs/dons-de-rhya/MANIFEST-000856 and /dev/null differ diff --git a/packs/plats-dauberges/000858.log b/packs/plats-dauberges/000870.log similarity index 100% rename from packs/plats-dauberges/000858.log rename to packs/plats-dauberges/000870.log diff --git a/packs/plats-dauberges/MANIFEST-000856 b/packs/plats-dauberges/MANIFEST-000856 deleted file mode 100644 index e75875c..0000000 Binary files a/packs/plats-dauberges/MANIFEST-000856 and /dev/null differ diff --git a/packs/tables-des-traductions/000501.log b/packs/tables-des-traductions/000513.log similarity index 100% rename from packs/tables-des-traductions/000501.log rename to packs/tables-des-traductions/000513.log diff --git a/packs/tables-des-traductions/MANIFEST-000499 b/packs/tables-des-traductions/MANIFEST-000499 deleted file mode 100644 index 64cda75..0000000 Binary files a/packs/tables-des-traductions/MANIFEST-000499 and /dev/null differ