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.
 
 
 

31 lines
976 B

import { FEATURE_CONTROL, TVA_CONFIG } from '../settings.js';
import { registerHook, unregisterHook } from './hooks.js';
const feature_id = 'EffectIcons';
export function registerEffectIconHooks() {
// OnHover settings specific hooks
if (FEATURE_CONTROL[feature_id] && TVA_CONFIG.displayEffectIconsOnHover) {
registerHook(feature_id, 'hoverToken', (token, hoverIn) => {
if (token.effects) {
token.effects.visible = hoverIn;
}
});
} else {
unregisterHook(feature_id, 'hoverToken');
}
if (FEATURE_CONTROL[feature_id] && TVA_CONFIG.displayEffectIconsOnHover) {
registerHook(feature_id, 'highlightObjects', (active) => {
if (canvas.tokens.active) {
for (const tkn of canvas.tokens.placeables) {
if (tkn.effects) {
tkn.effects.visible = active || tkn.hover;
}
}
}
});
} else {
unregisterHook(feature_id, 'highlightObjects');
}
}