changed setting to a drop down of actor packs
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user