Add option to show colors of PCs to anyone, regardless of permissions
This commit is contained in:
+3
-1
@@ -174,7 +174,9 @@ function getColorForDistance(startDistance, subDistance) {
|
||||
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
|
||||
// If this is a pc and alwaysShowSpeedForPCs is enabled we show the color anyway
|
||||
if (!(this.draggedToken.actor.data.type === "character" && game.settings.get(settingsKey, "alwaysShowSpeedForPCs")))
|
||||
return this.color
|
||||
}
|
||||
const distance = startDistance + subDistance
|
||||
const ranges = currentSpeedProvider(this.draggedToken, this.color)
|
||||
|
||||
@@ -4,6 +4,15 @@ import {getDefaultDashMultiplier, getDefaultSpeedAttribute} from "./systems.js"
|
||||
export const settingsKey = "drag-ruler";
|
||||
|
||||
export function registerSettings() {
|
||||
game.settings.register(settingsKey, "alwaysShowSpeedForPCs", {
|
||||
name: "drag-ruler.settings.alwaysShowSpeedForPCs.name",
|
||||
hint: "drag-ruler.settings.alwaysShowSpeedForPCs.hint",
|
||||
scope: "world",
|
||||
config: true,
|
||||
type: Boolean,
|
||||
default: true,
|
||||
})
|
||||
|
||||
// This setting will be modified by the api if modules register to it
|
||||
game.settings.register(settingsKey, "speedProvider", {
|
||||
name: "drag-ruler.settings.speedProvider.name",
|
||||
|
||||
Reference in New Issue
Block a user