All user data for FoundryVTT. Includes worlds, systems, modules, and any asset in the "foundryuserdata" directory. Does NOT include the FoundryVTT installation itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

  1. import { registerEffectIconWrappers } from './effectIconWrappers.js';
  2. import { registerHideElementWrappers } from './hideElementWrappers.js';
  3. import { registerHUDWrappers } from './hudWrappers.js';
  4. import { registerUserMappingWrappers } from './userMappingWrappers.js';
  5. export const REGISTERED_WRAPPERS = {};
  6. export function registerWrapper(feature_id, name, fn, method = 'WRAPPER') {
  7. if (typeof libWrapper !== 'function') return;
  8. if (!(feature_id in REGISTERED_WRAPPERS)) REGISTERED_WRAPPERS[feature_id] = {};
  9. if (name in REGISTERED_WRAPPERS[feature_id]) return;
  10. REGISTERED_WRAPPERS[feature_id][name] = libWrapper.register('token-variants', name, fn, method);
  11. }
  12. export function unregisterWrapper(feature_id, name) {
  13. if (typeof libWrapper !== 'function') return;
  14. if (feature_id in REGISTERED_WRAPPERS && name in REGISTERED_WRAPPERS[feature_id]) {
  15. libWrapper.unregister('token-variants', REGISTERED_WRAPPERS[feature_id][name]);
  16. delete REGISTERED_WRAPPERS[feature_id][name];
  17. }
  18. }
  19. export function registerAllWrappers() {
  20. // User to Image mappings for Tile and Tokens
  21. registerUserMappingWrappers();
  22. // Hide effect icons
  23. registerEffectIconWrappers();
  24. // Token HUD Variants Management
  25. registerHUDWrappers();
  26. // Hide Core Token Elements
  27. registerHideElementWrappers();
  28. }