Sync with new Compendium structure
This commit is contained in:
@ -52,9 +52,11 @@ Hooks.on("chatMessage", (html, content, msg) => {
|
||||
Hooks.once('ready', () => {
|
||||
|
||||
const lang = game.settings.get('core', 'language');
|
||||
if ( lang == "fr" ) {
|
||||
game.packs.forEach((pack, idx) => {
|
||||
if(!pack.translated && pack.entity === 'Actor') {
|
||||
if ( lang == "fr" ) {
|
||||
let pack_array = [];
|
||||
game.packs.forEach((pack, name) => {
|
||||
let newpack = pack;
|
||||
if(!pack.translated && pack.entity === 'Actor') {
|
||||
let translations = {
|
||||
"label": pack.metadata.name,
|
||||
"mapping": {
|
||||
@ -71,11 +73,12 @@ Hooks.once('ready', () => {
|
||||
},
|
||||
"entries": [
|
||||
]
|
||||
};
|
||||
};
|
||||
console.log("Actor compendium has been replaced !!!!");
|
||||
game.packs[idx] = new TranslatedCompendium(pack, translations);
|
||||
newpack = new TranslatedCompendium(pack, translations);
|
||||
}
|
||||
pack_array.push( [name, newpack ] );
|
||||
} );
|
||||
game.packs = new Collection( pack_array );
|
||||
}
|
||||
|
||||
} );
|
||||
|
Reference in New Issue
Block a user