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.
 
 
 

43 lines
1.1 KiB

export const SYSTEM_ID = 'z-scatter';
const settings = {
snapTokens: {
name: 'Snap Tokens',
scope: 'world',
config: false,
type: Boolean,
default: true,
onChange: (value) => canvas.tokens.placeables.forEach((t) => t.refresh()),
},
scatter: {
name: 'Scattering',
hint: 'How much the tokens will scatter around?',
scope: 'world',
config: true,
type: Number,
default: 0.4,
range: {
min: 0.01,
max: 1,
step: 0.01,
},
},
ignoreDead: {
name: 'Ignore Special Cases',
hint: 'Dead or incapacitated tokens will not be snapped.',
scope: 'world',
config: true,
type: Boolean,
default: true,
},
};
export function getSetting(name) {
return game.settings.get(SYSTEM_ID, name);
}
export function setSetting(name, value) {
return game.settings.set(SYSTEM_ID, name, value);
}
Hooks.once('setup', () => {
for (const [key, setting] of Object.entries(settings)) {
game.settings.register(SYSTEM_ID, key, setting);
}
});