forked from public/foundryvtt-wh4-lang-fr-fr
New fixes for v7.0.0
This commit is contained in:
@ -78,7 +78,7 @@ async function __findItem(itemName, itemType, location = null) {
|
||||
|
||||
// Search imported items first
|
||||
for (let i of items) {
|
||||
if (i.name == itemName && i.type == itemType)
|
||||
if (i.name.toLowerCase() == itemName.toLowerCase() && i.type == itemType)
|
||||
return i;
|
||||
}
|
||||
let itemList
|
||||
@ -91,7 +91,7 @@ async function __findItem(itemName, itemType, location = null) {
|
||||
})
|
||||
if (pack) {
|
||||
await pack.getIndex().then(index => itemList = index);
|
||||
let searchResult = itemList.find(t => (t.translated && t.originalName.toLowerCase() == toSearch) || (t.name.toLowerCase() == toSearch) );
|
||||
let searchResult = itemList.find(t => (t.translated && t.type == itemType && t.originalName.toLowerCase() == toSearch) || (t.type == itemType && t.name.toLowerCase() == toSearch) );
|
||||
if (searchResult)
|
||||
return await pack.getDocument(searchResult._id)
|
||||
}
|
||||
@ -100,7 +100,7 @@ async function __findItem(itemName, itemType, location = null) {
|
||||
// If all else fails, search each pack
|
||||
for (let p of game.wfrp4e.tags.getPacksWithTag(itemType)) {
|
||||
await p.getIndex().then(index => itemList = index);
|
||||
let searchResult = itemList.find(t => (t.translated && t.originalName.toLowerCase() == toSearch) || (t.name.toLowerCase() == toSearch) );
|
||||
let searchResult = itemList.find(t => (t.translated && t.type == itemType && t.originalName.toLowerCase() == toSearch) || (t.type == itemType && t.name.toLowerCase() == toSearch) );
|
||||
if (searchResult)
|
||||
return await p.getDocument(searchResult._id)
|
||||
}
|
||||
@ -134,7 +134,8 @@ async function __findSkill(skillName, value = undefined) {
|
||||
let spec = XRegExp.replace(skillSplit.specialized, "(", "");
|
||||
spec = XRegExp.replace(spec, ")", "");
|
||||
let skillSplit2 = XRegExp.exec(dbSkill.name, XRegExp(parseStr, 'gi'));
|
||||
dbSkill.update( { name: skillSplit2.name + '(' + game.i18n.localize( spec.trim() ) + ')' } );
|
||||
dbSkill.name = skillSplit2.name + '(' + game.i18n.localize( spec.trim() ) + ')'
|
||||
//dbSkill.update( { name: } );
|
||||
}
|
||||
//game.babele.translate('wfrp4e-core.skills', dbSkill);
|
||||
return dbSkill;
|
||||
@ -195,7 +196,7 @@ export default async function statParserFR(statString, type = "npc") {
|
||||
let sectionData = sectionDataUS
|
||||
// Detect French stat block
|
||||
if (statString.includes('CC') && statString.includes('CT') && statString.includes('FM')) {
|
||||
ui.notifications.warn("Le parsing de stablock en Français n'est pas encore prêt")
|
||||
//ui.notifications.warn("Le parsing de stablock en Français n'est pas encore prêt")
|
||||
statNameReg = fr_carac
|
||||
sectionData = sectionDataFR
|
||||
}
|
||||
@ -285,6 +286,7 @@ export default async function statParserFR(statString, type = "npc") {
|
||||
if (itemFound && value && value.length > 0) {
|
||||
if (name.toLowerCase() == 'weapon' || name.toLowerCase() == "bite" || name.toLowerCase() == "tail" ||
|
||||
name.toLowerCase() == 'arme' || name.toLowerCase() == "morsure" || name.toLowerCase() == "queue") {
|
||||
console.log(itemFound)
|
||||
itemFound.system.specification.value = Number(value) - Math.floor( Number(model.characteristics.s.initial) / 10)
|
||||
} else {
|
||||
itemFound.system.specification.value = game.i18n.localize(value)
|
||||
|
Reference in New Issue
Block a user