Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

Add "lock" to advanced menu for items

1401452844

Edited 1401452997
DXWarlock
Sheet Author
API Scripter
Would it be possible to add a simple "lock" option to the rightclick menu of images/tokens/etc? It would help GREATLY on pages where we have a good bit of items on the map layer and trying to move one, or select it and we pick the map itself, or something near it. I sometimes tend to get a bit over zealous on dungeon map making, and prefer to put chests/torches/items/tables as tokens on map layer vs actually on the map image..as my players like to push tables around, move torches..etc. I don't know how many times I go to move a torch, or chest, etc..and grab the map itself and drag it 1/4 of the way off the screen. And while cntl-z works to put it back, it throws the players off for a second while I go "whoops! ignore that part of the map you see now!" being able to lock an item from moving would save the headache and worry all around :) Come to think of it (a bit more advanced version of it), it could work dual purpose if it was also API accessable, for those people looking to stop players from moving tokens out of turn..make an API script to lock all but current turn token.
+1 I rarely make maps in other programs before importing them as a single file and much prefer to build maps from textures and tilesets on Roll20, so this would be amazing for locking down walls, while still being able to move objects. The only trouble with this I see is how are you ever going to re-select the object if you want to UN-lock it? Maybe a double click or hold mouse press? Maybe the easier way is to separate the "map" layer into 2 layers: "Background" for the floor, walls, and other static things, and "Objects" for chests, tables, torches, etc.
1401483373
DXWarlock
Sheet Author
API Scripter
Oh wasn't saying make it clickable, just not movable. Click it and select it all you want, just you can't drag it anywhere was my idea on it.
This definitely has my support.
You could do this via an api script pretty easily. Use the state variable to track a list of token ids which are not allowed to move, then you'd select the tokens to lock, exec !lock (or similar, and mappable to a macro). Then have an on('change:graphic', function) that sees if the graphic is in the list of locked items. If it is, restore it to the previous position. !unlock would simply need to remove the items from state.lockeditems. It's structurally similar to the pause script I wrote, which locks all tokens not on the gm layer, so check that out to see how it works and shout if you need help writing one :)