diff --git a/lang/en.json b/lang/en.json index 19317228..4355140e 100755 --- a/lang/en.json +++ b/lang/en.json @@ -355,7 +355,8 @@ "CompendiumBrowserSettings": { "title": "Enable Compendiums", "enableSource": "Enable Source", - "disableSource": "Disable Source" + "disableSource": "Disable Source", + "worldCompendiums": "World Compendiums" }, "ContextMenu": { "disableEffect": "Disable Effect", diff --git a/module/applications/dialogs/CompendiumBrowserSettings.mjs b/module/applications/dialogs/CompendiumBrowserSettings.mjs index 42d0e256..bef54a6f 100644 --- a/module/applications/dialogs/CompendiumBrowserSettings.mjs +++ b/module/applications/dialogs/CompendiumBrowserSettings.mjs @@ -50,13 +50,20 @@ export default class CompendiumBrowserSettings extends HandlebarsApplicationMixi const excludedSourceData = this.browserSettings.excludedSources; const excludedPackData = this.browserSettings.excludedPacks; context.typePackCollections = game.packs.reduce((acc, pack) => { - const { type, label, packageType, packageName, id } = pack.metadata; - if (packageType === 'world' || !CompendiumBrowserSettings.#browserPackTypes.includes(type)) return acc; + const { type, label, packageType, packageName: basePackageName, id } = pack.metadata; + if (!CompendiumBrowserSettings.#browserPackTypes.includes(type)) return acc; + const isWorldPack = packageType === 'world'; + const packageName = isWorldPack ? 'world' : basePackageName; const sourceChecked = !excludedSourceData[packageName] || !excludedSourceData[packageName].excludedDocumentTypes.includes(type); - const sourceLabel = game.modules.get(packageName)?.title ?? game.system.title; + + const sourceLabel = + game.modules.get(packageName)?.title ?? + (isWorldPack + ? game.i18n.localize('DAGGERHEART.APPLICATIONS.CompendiumBrowserSettings.worldCompendiums') + : game.system.title); if (!acc[type]) acc[type] = { label: game.i18n.localize(`DOCUMENT.${type}s`), sources: {} }; if (!acc[type].sources[packageName]) acc[type].sources[packageName] = { label: sourceLabel, checked: sourceChecked, packs: [] }; diff --git a/module/data/compendiumBrowserSettings.mjs b/module/data/compendiumBrowserSettings.mjs index 9e8025dd..ea71c439 100644 --- a/module/data/compendiumBrowserSettings.mjs +++ b/module/data/compendiumBrowserSettings.mjs @@ -24,7 +24,8 @@ export default class CompendiumBrowserSettings extends foundry.abstract.DataMode const pack = game.packs.get(item.pack); if (!pack) return false; - const excludedSourceData = this.excludedSources[pack.metadata.packageName]; + const packageName = pack.metadata.packageType === 'world' ? 'world' : pack.metadata.packageName; + const excludedSourceData = this.excludedSources[packageName]; if (excludedSourceData && excludedSourceData.excludedDocumentTypes.includes(pack.metadata.type)) return true; const excludedPackData = this.excludedPacks[item.pack];