changed setting to a drop down of actor packs

This commit is contained in:
2025-06-08 23:26:03 -05:00
parent 59f9022e43
commit b7b8b5c54a
3 changed files with 23 additions and 15 deletions
+9 -1
View File
@@ -1,11 +1,19 @@
import { moduleHelpers, settingKeys } from './globals.js';
import { moduleHelpers, settingKeys, log } from './globals.js';
export function registerSettings() {
const choices = {};
const packs = game.packs.filter((p) => p.documentName === 'Actor');
for (const pack of packs) {
choices[pack.metadata.id] = pack.metadata.label;
}
log('found packs', packs);
log('found choices', choices);
moduleHelpers.registerSetting(settingKeys.powerActorsCompendium, {
name: 'mbhelpers.settings.powerActorsCompendiumName',
hint: 'mbhelpers.settings.powerActorsCompendiumHint',
scope: 'world',
config: true,
choices,
requiresReload: false,
type: String,
});
+2 -3
View File
@@ -26,9 +26,6 @@ Hooks.once('init', async () => {
initVisionModes();
// Assign custom classes and constants here
// Register custom module settings
registerSettings();
// Preload Handlebars templates
await preloadTemplates();
});
@@ -36,6 +33,8 @@ Hooks.once('init', async () => {
// Setup module
Hooks.once('setup', async () => {
api.registerFunctions();
// Register custom module settings
registerSettings();
});
Hooks.once('ready', async () => {