Initial version

This commit is contained in:
WBHarry 2026-02-07 18:00:03 +01:00
parent c1f7866594
commit b053af21c6
13 changed files with 325 additions and 5 deletions

View file

@ -35,7 +35,8 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
selectFolder: this.selectFolder,
expandContent: this.expandContent,
resetFilters: this.resetFilters,
sortList: this.sortList
sortList: this.sortList,
openSettings: this.openSettings
},
position: {
left: 100,
@ -214,6 +215,10 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
loadItems() {
let loadTimeout = this.toggleLoader(true);
const excludedCompendiumPacks = game.settings.get(
CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings
).excludedCompendiumPacks;
const promises = [];
game.packs.forEach(pack => {
@ -227,7 +232,13 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
Promise.all(promises).then(async result => {
this.items = ItemBrowser.sortBy(
result.flatMap(r => r),
result
.flatMap(r => r)
.filter(x => {
const pack = game.packs.get(x.pack);
const packageName = pack.metadata.packageType === 'world' ? 'world' : pack.metadata.packageName;
return !excludedCompendiumPacks[packageName]?.[x.pack];
}),
'name'
);
@ -512,6 +523,10 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
itemListContainer.replaceChildren(...newOrder);
}
static async openSettings() {
new game.system.api.applications.dialogs.CompendiumBrowserSettingsDialog().render({ force: true });
}
_createDragProcess() {
new foundry.applications.ux.DragDrop.implementation({
dragSelector: '.item-container',