-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTagMany.js
36 lines (34 loc) · 935 Bytes
/
TagMany.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Tag many things (placeables) at the same time
Select any number of tiles, tokens or walls, run
this macro, type in a tag in its prompt, and
this tag is added to all your selections.
Ps. is dependent on the module "Tagger"
*/
function tagMany( tag ){
// Tag background elements
Tagger.addTags(canvas.background.controlled, tag);
// Tag foreground elements
Tagger.addTags(canvas.foreground.controlled, tag);
// Tag tokens
Tagger.addTags(canvas.tokens.controlled, tag);
// Tag walls:
Tagger.addTags(canvas.walls.controlled, tag);
}
let d = new Dialog({
title: "Set Tag",
content: "Which Tag<input type='text' id='MacroStateName'/>",
buttons: {
ok: {
icon: '<i class="fas fa-check"></i>',
label: "OK",
callback: () => {tagMany(document.getElementById('MacroStateName').value);}
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel"
}
},
default: "ok"
});
d.render(true);