This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
class CompendiumPacks extends DirectoryCollectionMixin(Collection) {
/**
* Get a Collection of Folders which contain Compendium Packs
* @returns {Collection<Folder>}
*/
get folders() {
return game.folders.reduce((collection, folder) => {
if ( folder.type === "Compendium" ) {
collection.set(folder.id, folder);
}
return collection;
}, new foundry.utils.Collection());
}
/* -------------------------------------------- */
/** @override */
_getVisibleTreeContents() {
return this.contents.filter(pack => pack.visible);
}
/* -------------------------------------------- */
/** @override */
static _sortAlphabetical(a, b) {
if ( a.metadata && b.metadata ) return a.metadata.label.localeCompare(b.metadata.label, game.i18n.lang);
else return super._sortAlphabetical(a, b);
}
}