Fix career + ajout traduction de tables
This commit is contained in:
@ -73,10 +73,15 @@ const _manage_inn_roll = async (content, msg) => {
|
||||
/************************************************************************************/
|
||||
let __eis_tables = { "animalmishap":1, "beasthead":1, "coincedentalenc":1, "demonic-mien":1,
|
||||
"expandedmutatemental":1, "expandedmutatephys":1, "fixations":1,
|
||||
"harmfulenc":1, "positiveenc":1, "weather":1, "mutatephys": 1
|
||||
"harmfulenc":1, "positiveenc":1, "weather":1, "mutatephys": 1,
|
||||
"vehiclemishap": 1,"quadruped": 1, "ridingmishap": 1
|
||||
}
|
||||
let __dotr_tables = { "rowingboat":1, "sailingboat":1
|
||||
}
|
||||
let __wfrp4e_tables = { "career": 1, "critbody":1, "critleg": 1, "doom": 1, "eyes": 1, "majormis": 1, "mutatemental": 1, "oops": 1, "species":1, "travel": 1,
|
||||
"hitloc": 1, "critarm": 1, "crithead": 1, "delirium": 1, "event": 1, "hair": 1, "minormis": 1, "mutatephys": 1, "talents": 1, "wrath": 1
|
||||
"hitloc": 1, "critarm": 1, "crithead": 1, "delirium": 1, "event": 1, "hair": 1, "minormis": 1, "mutatephys": 1, "talents": 1, "wrath": 1,
|
||||
"astral": 1, "corruption": 1, "snake": 1, "spider": 1
|
||||
|
||||
}
|
||||
let __to_table_translate = [ { name:"traits", transl:"Traits"}, {name:"talents", transl:"Talents"}, {name:"skills", transl:"Compétences"} ,
|
||||
{ name:"careers", transl:"Carrières"}, {name:"spells", transl:"Sorts"}, {name:"prayers", transl:"Bénédictions et Miracles" } ,
|
||||
@ -119,27 +124,39 @@ const __auto_patch_translation_journal_compendium = async (compmod) => {
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
const patch_core_tables = (tableList) => {
|
||||
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 ( tableList[filename] == 1 ) { // Matching table name -> patch !
|
||||
fetch(file).then(r=>r.json()).then(records => {
|
||||
console.log("Patch !!!", filename, records);
|
||||
//WFRP_Tables[filename] = records;
|
||||
game.wfrp4e.tables[filename] = records;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
const __check_fix_wrong_modules = ( chatFlag, patchFinished ) => {
|
||||
|
||||
WH4FRPatchConfig.perform_patch();
|
||||
|
||||
game.modules.forEach((module, name) => {
|
||||
|
||||
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 => {
|
||||
//console.log("Patch !!!", filename, records);
|
||||
//WFRP_Tables[filename] = records;
|
||||
game.wfrp4e.tables[filename] = records;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
patch_core_tables( __wfrp4e_tables );
|
||||
}
|
||||
|
||||
if ( name == "wfrp4e-eis" && module.active) {
|
||||
patch_core_tables( __eis_tables );
|
||||
}
|
||||
if ( name == "wfrp4e-dotr" && module.active) {
|
||||
patch_core_tables( __dotr_tables );
|
||||
}
|
||||
|
||||
if ( name == "wfrp4e-rnhd" && module.active && game.wfrp4e.tables.career) {
|
||||
game.wfrp4e.tables.career.name = "Carrières aléatoires";
|
||||
|
||||
|
Reference in New Issue
Block a user