Merge branch 'develop' into pathfinding
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
## 1.11.2
|
||||
### Bugfixes
|
||||
- Fixed a memory leak that could cause the rule to slow down after using the pathfinding functionality for a while
|
||||
|
||||
### Misc
|
||||
- GMs are now always allowed to use the pathfinding tool. The setting now only prevents players from using it.
|
||||
|
||||
### Compatibility
|
||||
- Drag Ruler's generic speed provider is now aware of good defaults for Dungeonslayers 4
|
||||
|
||||
|
||||
## 1.11.1
|
||||
### Bugfixes
|
||||
- Fixed a bug that would cause the pathfinding algorithm to make tokens of size 2 and 4 to take an unnecessary step
|
||||
|
||||
+8
-9
@@ -52,15 +52,14 @@ export function registerKeybindings() {
|
||||
precedence: -1,
|
||||
});
|
||||
|
||||
if (game.settings.get(settingsKey, "allowPathfinding")) {
|
||||
game.keybindings.register(settingsKey, "togglePathfinding", {
|
||||
name: "drag-ruler.keybindings.togglePathfinding.name",
|
||||
hint: "drag-ruler.keybindings.togglePathfinding.hint",
|
||||
onDown: handleTogglePathfinding,
|
||||
onUp: handleTogglePathfinding,
|
||||
precedence: -1,
|
||||
});
|
||||
}
|
||||
game.keybindings.register(settingsKey, "togglePathfinding", {
|
||||
name: "drag-ruler.keybindings.togglePathfinding.name",
|
||||
hint: "drag-ruler.keybindings.togglePathfinding.hint",
|
||||
onDown: handleTogglePathfinding,
|
||||
onUp: handleTogglePathfinding,
|
||||
precedence: -1,
|
||||
restricted: !game.settings.get(settingsKey, "allowPathfinding"),
|
||||
});
|
||||
}
|
||||
|
||||
function handleDeleteWaypoint() {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ let use5105 = false;
|
||||
let gridlessPathfinder = undefined;
|
||||
|
||||
export function isPathfindingEnabled() {
|
||||
if (!game.settings.get(settingsKey, "allowPathfinding"))
|
||||
if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding"))
|
||||
return false;
|
||||
return game.settings.get(settingsKey, "autoPathfinding") != togglePathfinding;
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import {availableSpeedProviders, currentSpeedProvider, getDefaultSpeedProvider, updateSpeedProvider} from "./api.js";
|
||||
import {SpeedProvider} from "./speed_provider.js"
|
||||
import { early_isGM } from "./util.js";
|
||||
|
||||
export const settingsKey = "drag-ruler";
|
||||
|
||||
@@ -96,7 +97,7 @@ export function registerSettings() {
|
||||
name: "drag-ruler.settings.autoPathfinding.name",
|
||||
hint: "drag-ruler.settings.autoPathfinding.hint",
|
||||
scpoe: "client",
|
||||
config: true,
|
||||
config: early_isGM(),
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
});
|
||||
|
||||
@@ -17,6 +17,8 @@ export function getDefaultSpeedAttribute() {
|
||||
return "actor.data.data.movement.walk.value";
|
||||
case "swade":
|
||||
return "actor.data.data.stats.speed.adjusted";
|
||||
case "ds4":
|
||||
return "actor.data.data.combatValues.movement.total";
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -32,6 +34,7 @@ export function getDefaultDashMultiplier() {
|
||||
case "D35E":
|
||||
case "sfrpg":
|
||||
case "shadowrun5e":
|
||||
case "ds4":
|
||||
return 2
|
||||
case "CoC7":
|
||||
return 5;
|
||||
|
||||
@@ -272,3 +272,10 @@ export function getMeasurePosition() {
|
||||
const measurePosition = {x: mousePosition.x + rulerOffset.x, y: mousePosition.y + rulerOffset.y};
|
||||
return measurePosition;
|
||||
}
|
||||
|
||||
// isGM function for use during loading when game.user isn't available yet
|
||||
export function early_isGM() {
|
||||
const level = game.data.users.find(u => u._id == game.data.userId).role;
|
||||
const gmLevel = CONST.USER_ROLES.ASSISTANT;
|
||||
return level >= gmLevel;
|
||||
}
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@
|
||||
},
|
||||
"settings": {
|
||||
"allowPathfinding": {
|
||||
"name": "Wegfindung aktivieren",
|
||||
"hint": "Aktiviert Drag Ruler's Wegfindungsfunktion. Bitte beachte, dass die Wegfindung Wege durch unerkundeten Nebel des Kriegs und Ätherische Wände berechnen kann. Dies kann deinen Spielern Geheimnisse lüften, von denen sie noch nicht erfahren sollten."
|
||||
"name": "Wegfindung für Spieler erlauben",
|
||||
"hint": "Erlaubt es Spielern die Wegfindungs zu benutzen. Bitte beachte, dass die Wegfindung Wege durch unerkundeten Nebel des Kriegs und Ätherische Wände berechnen kann. Dies kann deinen Spielern Geheimnisse lüften, von denen sie noch nicht erfahren sollten."
|
||||
},
|
||||
"alwaysShowSpeedForPCs": {
|
||||
"name": "Geschwindigkeit von Spielercharakteren für jeden anzeigen",
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@
|
||||
},
|
||||
"settings": {
|
||||
"allowPathfinding": {
|
||||
"name": "Enable pathfinding feature",
|
||||
"hint": "Enables Drag Ruler's pathfinding functionality in this world. Be aware that pathfinding can route through unexplored fog of war and Ethereal Walls, which might reveal secrets to your players ahead of time."
|
||||
"name": "Allow pathfinding for players",
|
||||
"hint": "Allows players to use Drag Ruler's pathfinding functionality in this world. Be aware that pathfinding can route through unexplored fog of war and Ethereal Walls, which might reveal secrets to your players ahead of time."
|
||||
},
|
||||
"alwaysShowSpeedForPCs": {
|
||||
"name": "Show PC speed to everyone",
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
"name": "drag-ruler",
|
||||
"title": "Drag Ruler",
|
||||
"description": "When dragging a token displays a ruler showing how far you've moved that token.",
|
||||
"version": "1.11.1",
|
||||
"version": "1.11.2",
|
||||
"minimumCoreVersion" : "9.245",
|
||||
"compatibleCoreVersion" : "9",
|
||||
"authors": [
|
||||
@@ -65,7 +65,7 @@
|
||||
],
|
||||
"socket": true,
|
||||
"url": "https://github.com/manuelVo/foundryvtt-drag-ruler",
|
||||
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.11.1.zip",
|
||||
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.11.2.zip",
|
||||
"manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-drag-ruler/master/module.json",
|
||||
"readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md",
|
||||
"changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md",
|
||||
|
||||
Reference in New Issue
Block a user