diff --git a/CHANGELOG.md b/CHANGELOG.md index a5334fa..cdb88ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## In development ### New features - Right click and spacebar can now be swapped, allowing to place waypoints with right click and removing them with spacebar +- The module can now be configured use a fixed color instead of the player color for the first speed range ### Bugfixes - Disabling snap to grid with shift now works as expected diff --git a/lang/en.json b/lang/en.json index a3c0243..4b837be 100644 --- a/lang/en.json +++ b/lang/en.json @@ -22,6 +22,10 @@ "system": "System" } }, + "staticFirstColor": { + "name": "Static First Color", + "hint": "Use a static color for the first movement range instead of the player color" + }, "swapSpacebarRightClick": { "name": "Swap spacebar and right click", "hint": "Swaps the functions of spacebar and right click during dragging. If enabled right click will place waypoints and spacebar will delete them" diff --git a/src/main.js b/src/main.js index 4075e1f..47debd5 100644 --- a/src/main.js +++ b/src/main.js @@ -216,7 +216,8 @@ function getColorForDistance(startDistance, subDistance) { return this.color } const distance = startDistance + subDistance - const ranges = currentSpeedProvider(this.draggedToken, this.color) + const firstColor = game.settings.get(settingsKey, "staticFirstColor") ? 0x00FF00 : this.color + const ranges = currentSpeedProvider(this.draggedToken, firstColor) if (ranges.length === 0) return this.color const currentRange = ranges.reduce((minRange, currentRange) => { diff --git a/src/settings.js b/src/settings.js index e8be3e1..8dcc4bb 100644 --- a/src/settings.js +++ b/src/settings.js @@ -53,4 +53,13 @@ export function registerSettings() { type: Number, default: getDefaultDashMultiplier(), }) + + game.settings.register(settingsKey, "staticFirstColor", { + name: "drag-ruler.settings.staticFirstColor.name", + hint: "drag-ruler.settings.staticFirstColor.hint", + scope: "world", + config: true, + type: Boolean, + default: false, + }) }