From 2211162069ca456f4aa125a7f625965b21efbdcc Mon Sep 17 00:00:00 2001 From: sladecraven Date: Thu, 5 Nov 2020 22:23:15 +0100 Subject: [PATCH] Setup new compendiums --- addon-register.js | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/addon-register.js b/addon-register.js index 04ead97..e2a623d 100644 --- a/addon-register.js +++ b/addon-register.js @@ -263,37 +263,21 @@ const __check_fix_wrong_modules = ( chatFlag, patchFinished ) => { game.modules.forEach((module, name) => { - if ( name == "wfrp4e-content" && module.active) { + if ( name == "wfrp4e-core" && module.active) { FilePicker.browse("data", "modules/WH4-fr-translation/tables/").then(resp => { for (var file of resp.files) { let filename = file.substring(file.lastIndexOf("/")+1, file.indexOf(".json")); if ( __wfrp4e_tables[filename] == 1 ) { // Matching table name -> patch ! fetch(file).then(r=>r.json()).then(records => { - WFRP_Tables[filename] = records; + game.wfrp4e.tables[filename] = records; }); } } }); } - - if ( name == "eis" && module.active) { - _patch_eis(); - FilePicker.browse("data", "modules/WH4-fr-translation/tables/").then(resp => { - for (var file of resp.files) { - let filename = file.substring(file.lastIndexOf("/")+1, file.indexOf(".json")); - if ( __eis_tables[filename] == 1 ) { // Matching table name -> patch ! - fetch(file).then(r=>r.json()).then(records => { - WFRP_Tables[filename] = records; - }); - } - } - }); - if (game.user.isGM && chatFlag) - ChatMessage.create( { title: "Module EiS patché", content: "Le module EiS a été detecté et automatiquement patché.", whisper: ChatMessage.getWhisperRecipients("GM") } ); - } - + if ( name == "wfrp4e-rnhd" && module.active ) { - WFRP_Tables.career.name = "Carrières aléatoires"; + game.wfrp4e.tables.career.name = "Carrières aléatoires"; FilePicker.browse("data", "modules/WH4-fr-translation/tables/").then(resp => { for (var file of resp.files) {