New fixes for v7.0.0
This commit is contained in:
@ -3,17 +3,23 @@ export class WH4FRPatchConfig {
|
||||
|
||||
/************************************************************************************/
|
||||
static translateSkillList( skillList) {
|
||||
|
||||
let compendiumName = 'wfrp4e-core.skills' // Per default
|
||||
if (game.system.version.match("7.")) {
|
||||
compendiumName = 'wfrp4e-core.items'
|
||||
}
|
||||
|
||||
let newList = [];
|
||||
for( let compName of skillList) {
|
||||
let special = "";
|
||||
let newName = compName;
|
||||
if ( compName.includes("(") && compName.includes(")") ) { // Then process specific skills name with (xxxx) inside
|
||||
var re = /(.*) +\((.*)\)/i;
|
||||
var res = re.exec( compName );
|
||||
let re = /(.*) +\((.*)\)/i;
|
||||
let res = re.exec( compName );
|
||||
compName = res[1].trim(); // Get the root skill name
|
||||
special = " (" + game.i18n.localize( res[2].trim() ) + ")"; // And the special keyword
|
||||
}
|
||||
var compNameFR = game.babele.translate( 'wfrp4e-core.skills', { name: compName }, true );
|
||||
let compNameFR = game.babele.translate( compendiumName, { name: compName }, true );
|
||||
//console.log(">>>>> Skill ?", compName, special, compNameFR);
|
||||
if (compNameFR.name != compName) { // Translation OK
|
||||
newName = compNameFR.name + special;
|
||||
@ -25,6 +31,12 @@ export class WH4FRPatchConfig {
|
||||
|
||||
/************************************************************************************/
|
||||
static translateTalentList( talentList) {
|
||||
|
||||
let compendiumName = 'wfrp4e-core.talents' // Per default
|
||||
if (game.system.version.match("7.")) {
|
||||
compendiumName = 'wfrp4e-core.items'
|
||||
}
|
||||
|
||||
let newList = [];
|
||||
for( let talentLine of talentList) {
|
||||
let special = "";
|
||||
@ -36,12 +48,12 @@ export class WH4FRPatchConfig {
|
||||
talentName = talentName.trim();
|
||||
let newName2 = talentName;
|
||||
if ( talentName.includes("(") && talentName.includes(")") ) { // Then process specific skills name with (xxxx) inside
|
||||
var re = /(.*) +\((.*)\)/i;
|
||||
var res = re.exec( talentName );
|
||||
let re = /(.*) +\((.*)\)/i;
|
||||
let res = re.exec( talentName );
|
||||
talentName = res[1].trim(); // Get the root skill name
|
||||
special = " (" + game.i18n.localize( res[2].trim() ) + ")"; // And the special keyword
|
||||
}
|
||||
var talentNameFR = game.babele.translate( 'wfrp4e-core.talents', { name: talentName }, true );
|
||||
let talentNameFR = game.babele.translate( compendiumName, { name: talentName }, true );
|
||||
//console.log(">>>>> Talent ?", talentName, special, talentNameFR);
|
||||
if (talentNameFR.name != talentName) { // Translation OK
|
||||
newName2 = talentNameFR.name + special;
|
||||
@ -90,6 +102,11 @@ export class WH4FRPatchConfig {
|
||||
|
||||
/************************************************************************************/
|
||||
static patch_career() {
|
||||
let compendiumName = 'wfrp4e-core.careers' // Per default
|
||||
if (game.system.version.match("7.")) {
|
||||
compendiumName = 'wfrp4e-core.items'
|
||||
}
|
||||
|
||||
if ( game.wfrp4e.tables.career) {
|
||||
for( let row of game.wfrp4e.tables.career.rows) {
|
||||
for ( let key in row) {
|
||||
@ -100,7 +117,7 @@ export class WH4FRPatchConfig {
|
||||
row[key].name = "Duelliste";
|
||||
//console.log(">>>>> Career ?", key, row[key].name, career_fr.name );
|
||||
} else {
|
||||
var career_fr = game.babele.translate( 'wfrp4e-core.careers', {name: row[key].name}, true );
|
||||
let career_fr = game.babele.translate( compendiumName, {name: row[key].name}, true );
|
||||
row[key].name = career_fr.name;
|
||||
}
|
||||
}
|
||||
@ -121,7 +138,7 @@ export class WH4FRPatchConfig {
|
||||
}
|
||||
|
||||
// Detect and patch as necessary
|
||||
if (game.wfrp4e.config && game.wfrp4e.config.talentBonuses && game.wfrp4e.config.talentBonuses["vivacité"] == undefined) {
|
||||
if (game.wfrp4e.config?.talentBonuses && game.wfrp4e.config.talentBonuses["vivacité"] == undefined) {
|
||||
console.log("Patching WFRP4E now ....");
|
||||
game.wfrp4e.config.qualityDescriptions["distract"] = game.i18n.localize("WFRP4E.Properties.Distract"); // Patch missing quality
|
||||
|
||||
|
Reference in New Issue
Block a user