Fix for wfrp 4.0

This commit is contained in:
sladecraven 2021-07-08 13:46:30 +02:00
parent 716a27f6ad
commit 3fbd6d733f
2 changed files with 10 additions and 17 deletions

View File

@ -407,26 +407,19 @@ Hooks.once('init', () => {
},
"trapping_qualities_flaws": (value) => {
if ( value ) {
//console.log("ATOUTS", value);
var list = value.split( "," );
let newQF = [];
console.log("ATOUTS", value);
var i=0;
var re = /(.*) (\d+)/i;
for (i=0; i<list.length; i++) {
let trim = list[i].trim();
if ( trim == "Trap Blade") {
trim = "TrapBlade"; // Auto-patch, without space!
//var re = /(.*) (\d+)/i;
for (i=0; i<value.length; i++) {
newQF[i] = duplicate(value[i]);
if ( newQF[i].name == "Trap Blade") {
newQF[i].name = "TrapBlade"; // Auto-patch, without space!
//console.log("PATCHED", trim);
}
var splitted = re.exec( trim );
//console.log("Current quality", splitted, trim );
if ( splitted ) {
//console.log("FOund:", splitted[0], splitted[1], splitted[2] );
list[i] = game.i18n.localize( splitted[1] ) + " " + splitted[2];
} else {
list[i] = game.i18n.localize( trim ) ;
}
newQF[i].name = game.i18n.localize( newQF[i].name ) ;
}
return list.toString();
return newQF;
}
},
// Search back in careers the translated name of the groupe (as it is the name of the level career itself)

View File

@ -2,7 +2,7 @@
"name": "WH4-fr-translation",
"title": "WFRP4e - Core Module en français.",
"description": "Traduction Française pour Warhammer v4.",
"version": "4.0.0",
"version": "4.0.1",
"minimumCoreVersion" : "0.8.0",
"compatibleCoreVersion": "0.8.8",
"author": "LeRatierBretonnien",