Fix commande /auberge

This commit is contained in:
sladecraven 2021-07-20 15:15:13 +02:00
parent 769ac9b6d2
commit 8e80c7a005
3 changed files with 11 additions and 15 deletions

View File

@ -37,8 +37,8 @@ const _manage_inn_roll = async (content, msg) => {
let command = content.split(" ").map(function(item) {
return item.trim();
})
//console.log(game.wfrp4e.tables["talents"]);
console.log("COMMANDES", command);
if (command[0] == "/auberge" && command[1] )
{
msg["type"] = 0;
@ -46,17 +46,14 @@ const _manage_inn_roll = async (content, msg) => {
var compendium = game.packs.get('WH4-fr-translation.plats-dauberges');
let rollList = [];
await compendium.getIndex().then(index => rollList = index);
//console.log("Got compendium...", rollList.length);
rollList = rollList.contents;
for (var i=0; i< rollList.length; i++) {
var rollTab = rollList[i];
console.log("Got compendium...", rollList, rollTab.name);
if ( rollTab.name.toLowerCase().includes(command[1].toLowerCase()) ) {
let my_rollTable;
await compendium.getEntity(rollTab._id).then(mytab => my_rollTable = mytab);
let myroll = my_rollTable.roll();
//console.log("RES: ", myroll );
msg.content = my_rollTable.name + " : " + myroll.results[0].text;
//my_rollTable.draw();
ChatMessage.create(msg);
await compendium.getDocument(rollTab._id).then(mytab => my_rollTable = mytab);
my_rollTable.draw( { rollMode : "gmroll"} );
return false;
}
}
@ -243,7 +240,7 @@ const __add_actors_translation = ( ) => {
//newpack = new TranslatedCompendium(pack, translations);
//console.log("Actor compendium has been replaced !!!!", pack.metadata.name);
}
console.log("Parsing pack", metadata);
//console.log("Parsing pack", metadata);
if (!game.babele.isTranslated(metadata) && metadata.name == "forien-armoury" ) {
/** TODO !!!/
metadata.mapping.mapping["qualities"] = {
@ -266,11 +263,10 @@ const __add_actors_translation = ( ) => {
/* Hook for specific command */
Hooks.on("chatMessage", (html, content, msg) => {
if ( content.includes("/auberge") ) {
if ( content.toLowerCase().includes('auberge') ) {
_manage_inn_roll( content, msg );
return false;
}
} );
/************************************************************************************/

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.7",
"version": "4.0.8",
"minimumCoreVersion" : "0.8.0",
"compatibleCoreVersion": "0.8.8",
"author": "LeRatierBretonnien",