Only show range colors to players who have observer permissions for that token
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
## In development
|
## In development
|
||||||
### New features
|
### New features
|
||||||
- The drag ruler will now be colored for other players than the dragging player as well
|
- The drag ruler will now be colored for other players than the dragging player as well (only if they have at least observer permissions for that token)
|
||||||
- The drag ruler won't be shown to other players if they cannot see the dragged token
|
- The drag ruler won't be shown to other players if they cannot see the dragged token
|
||||||
|
|
||||||
## v1.0.1
|
## v1.0.1
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ function nativeSpeedProvider(token, playercolor) {
|
|||||||
function getColorForDistance(startDistance, subDistance) {
|
function getColorForDistance(startDistance, subDistance) {
|
||||||
if (!this.isDragRuler)
|
if (!this.isDragRuler)
|
||||||
return this.color
|
return this.color
|
||||||
|
// Don't apply colors if the current user doesn't have at least observer permissions
|
||||||
|
if (this.draggedToken.actor.permission < 2) {
|
||||||
|
return this.color
|
||||||
|
}
|
||||||
const distance = startDistance + subDistance
|
const distance = startDistance + subDistance
|
||||||
const ranges = currentSpeedProvider(this.draggedToken, this.color)
|
const ranges = currentSpeedProvider(this.draggedToken, this.color)
|
||||||
if (ranges.length === 0)
|
if (ranges.length === 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user