forked from public/foundryvtt-wh4-lang-fr-fr
Various enhancements
This commit is contained in:
@ -152,7 +152,7 @@ const fr_carac = 'm\\s+ws\\s+bs\\s+s\\s+t\\s+i\\s+agi?\\s+dex\\s+int\\s+\\wp\\s+
|
||||
const carac_val = '(?<M>[0-9-]+)\\s+(?<WS>[0-9-]+)\\s+(?<BS>[0-9-]+)\\s+(?<S>[0-9-]+)\\s+(?<T>[0-9-]+)\\s+(?<I>[0-9-]+)\\s+(?<Ag>[0-9-]+)\\s+(?<Dex>[0-9-]+)\\s+(?<Int>[0-9-]+)\\s+(?<WP>[0-9-]+)\\s+(?<Soc>[0-9-]+)\\s+(?<W>[0-9-]+)';
|
||||
let sectionData = [
|
||||
{ name: "trait", toFind:"Traits\\s*:", secondParse: '(?<name>[a-z\\s]*)[\\s\\+]*(?<value>.*|[0-9]+)', index:-1 },
|
||||
{ name: "skill", toFind:"Skills\\s*:", index:-1 },
|
||||
{ name: "skill", toFind:"Skills\\s*:", secondParse: '(?<name>[a-z\\s]*)[\\s\\+]*(?<value>.*|[0-9]+)', index:-1 },
|
||||
{ name: "talent", toFind:"Talents\\s*:", index:-1 },
|
||||
{ name: "trapping", toFind:"Trappings\\s*:", index:-1 }
|
||||
];
|
||||
@ -199,17 +199,21 @@ Hooks.once('ready', () => {
|
||||
let subres = XRegExp.exec( name, XRegExp(def.secondParse, 'gi') );
|
||||
console.log("Subres", subres);
|
||||
name = subres.name.trim();
|
||||
if ( subres.value.length > 0 ) {
|
||||
if ( subres.value.substring(0, 1) == '(' )
|
||||
name += ' ' + subres.value;
|
||||
else
|
||||
name += ' (' + subres.value + ')';
|
||||
}
|
||||
if ( def.name == 'trait') {
|
||||
if ( subres.value.length > 0 ) {
|
||||
if ( subres.value.substring(0, 1) == '(' )
|
||||
name += ' ' + subres.value;
|
||||
else
|
||||
name += ' (' + subres.value + ')';
|
||||
}
|
||||
} else if ( def.name == 'skill') {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
def.termList.push( { name: name, type: def.name, data: { description: { value: "" } } } );
|
||||
}
|
||||
let newlist = autoTranslateItems( def.termList );
|
||||
console.log(newlist);
|
||||
def.itemList = autoTranslateItems( def.termList );
|
||||
console.log(def.itemList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user