Fix auto-translation

This commit is contained in:
2020-07-19 00:01:28 +02:00
parent 7c20c67d19
commit e05ef91847
4 changed files with 35 additions and 28 deletions

View File

@ -345,30 +345,9 @@ const __check_fix_wrong_modules = ( chatFlag, patchFinished ) => {
}
/************************************************************************************/
/* Hook for specific command */
Hooks.on("chatMessage", (html, content, msg) => {
if ( content.includes("/auberge") ) {
_manage_inn_roll( content, msg );
return false;
}
} );
/************************************************************************************/
/* Additionnal hooks ready */
Hooks.once('ready', () => {
if (game.user.isGM)
ChatMessage.create( { title: "Patch en progression", content: "<strong>Les modules WFRP4E sont en cours de patch pour traduction... Merci d'attendre le message de fin...</strong>", whisper: ChatMessage.getWhisperRecipients("GM") } );
setTimeout( __check_fix_wrong_modules, 2000, true, false);
setTimeout( __check_fix_wrong_modules, 10000, false, false);
setTimeout( __check_fix_wrong_modules, 20000, false, true);
const __add_actors_translation = ( ) => {
const lang = game.settings.get('core', 'language');
if ( lang == "fr" ) {
if ( lang == "fr" ) {
let pack_array = [];
game.packs.forEach((pack, name) => {
let newpack = pack;
@ -408,8 +387,32 @@ Hooks.once('ready', () => {
pack_array.push( [name, newpack ] );
} );
game.packs = new Collection( pack_array );
}
}
/************************************************************************************/
/* Hook for specific command */
Hooks.on("chatMessage", (html, content, msg) => {
if ( content.includes("/auberge") ) {
_manage_inn_roll( content, msg );
return false;
}
} );
/************************************************************************************/
/* Additionnal hooks ready */
Hooks.once('ready', () => {
if (game.user.isGM)
ChatMessage.create( { title: "Patch en progression", content: "<strong>Les modules WFRP4E sont en cours de patch pour traduction... Merci d'attendre le message de fin...</strong>", whisper: ChatMessage.getWhisperRecipients("GM") } );
setTimeout( __check_fix_wrong_modules, 2000, true, false);
setTimeout( __check_fix_wrong_modules, 10000, false, false);
setTimeout( __check_fix_wrong_modules, 20000, false, true);
setTimeout( __add_actors_translation, 21000, false, true);
let compmod = "wfrp4e";
// Check various settings in the installation
game.modules.forEach((module, name) => {