import { api } from './api.js' import { log, shim, CONST } from './shim.js' function _checkModule (name) { if (!game.modules.get(name)?.active && game.user.isGM) { let action = 'install and activate' if (game.modules.get(name)) action = 'activate' ui.notifications.error( `SWADE MB Helpers requires the ${name} module. Please ${action} it.`) } } Hooks.on('setup', api.registerFunctions) Hooks.on('ready', () => { _checkModule('warpgate') CONST.FOUNDRY = foundry.CONST CONST.SWADE = CONFIG.SWADE.CONST log('Initialized SWADE MB Helpers') })