Presets - Aedif/multi-token-edit GitHub Wiki
Any configuration window opened using the module will have a 'Presets' header button. It will open up a window where you can store currently selected fields and re-use them later. Alternatively you can drag in a placeable from the canvas onto the form to create a preset from it.
The window can also be opened using Scene controls
and a keybind (Shift+X
by default)
Short video clip: https://youtu.be/MRjHXc3MJWA
- MassEdit.getPreset
- MassEdit.getPresets
- MassEdit.spawnPreset
- MassEdit.createPreset
Documentation
/**
* Retrieve preset
* @param {object} [options={}]
* @param {String} [options.uuid] Preset UUID
* @param {String} [options.name] Preset name
* @param {String} [options.type] Preset type ("Token", "Tile", etc)
* @param {String} [options.folder] Folder name
* @returns {Preset}
*/
static async getPreset({ uuid, name, type, folder } = {})
/**
* Retrieve presets
* @param {object} [options={}]
* @param {String} [options.uuid] Preset UUID
* @param {String} [options.name] Preset name
* @param {String} [options.type] Preset type ("Token", "Tile", etc)
* @param {String} [options.folder] Folder name
* @param {String} [options.format] The form to return placeables in ('preset', 'name', 'nameAndFolder')
* @returns {Array[Preset]|Array[String]|Array[Object]}
*/
static async getPresets({ uuid, name, type, folder, format = 'preset' } = {})
/**
* Spawn a preset on the scene (id, name or preset itself are required).
* By default the current mouse position is used.
* @param {object} [options={}]
* @param {Preset} [options.preset] Preset
* @param {String} [options.uuid] Preset UUID
* @param {String} [options.name] Preset name
* @param {String} [options.type] Preset type ("Token", "Tile", etc)
* @param {Number} [options.x] Spawn canvas x coordinate (mouse position used if x or y are null)
* @param {Number} [options.y] Spawn canvas y coordinate (mouse position used if x or y are null)
* @param {Boolean} [options.snapToGrid] If 'true' snaps spawn position to the grid.
* @param {Boolean} [options.hidden] If 'true' preset will be spawned hidden.
* @param {Boolean} [options.layerSwitch] If 'true' the layer of the spawned preset will be activated.
* @param {Boolean} [options.coordPicker] If 'true' a crosshair and preview will be enabled allowing spawn position to be picked
* @param {String} [options.pickerLabel] Label displayed above crosshair when `coordPicker` is enabled
* @param {String} [options.taPreview] Designates the preview placeable when spawning a `Token Attacher` prefab. e.g. "Tile", "Tile.1", "MeasuredTemplate.3"
* @returns {Array[Document]}
*/
static async spawnPreset({ uuid, preset, name, type, folder, x, y, coordPicker = false, pickerLabel, taPreview, snapToGrid = true, hidden = false, layerSwitch = false,
} = {})
/**
* Create Presets from passed in placeables
* @param {PlaceableObject|Array[PlaceableObject]} placeables Placeable/s to create the presets from.
* @param {object} [options={}] Optional Preset information
* @param {String} [options.name] Preset name
* @param {String} [options.img] Preset thumbnail image
* @returns {Preset|Array[Preset]}
*/
static async createPreset(placeables, options = {})