Setup new compendiums

This commit is contained in:
sladecraven 2020-11-05 22:23:15 +01:00
parent a37a2e4279
commit 2211162069

View File

@ -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 <strong>automatiquement patché</strong>.", 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) {