Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a65ff4ddb4 | |||
| c2aa47985b | |||
| 4b5fea0763 | |||
| 26c3475db6 | |||
| 2cf97e2804 | |||
| 7dcb8b5c71 | |||
| a9c15d779b | |||
| 01b9941c16 | |||
| 7bd5ad3dad | |||
| 6b4965f507 | |||
| e57829936e | |||
| 1713380900 | |||
| 0896265f87 | |||
| 8a91c8843d | |||
| 4787ae5e12 |
@@ -1,3 +1,20 @@
|
||||
## 1.13.2
|
||||
### Bugfixes
|
||||
- Fixed a bug that prevented pathfinding on hex to work when the hex size support module is not installed
|
||||
|
||||
## 1.13.1
|
||||
### Bugfixes
|
||||
- Fixed a bug that caused large hex tokens to not snap correctly
|
||||
- Fixed a bug that prevented Drag Ruler from working on hex grids at all if the Hex Size Support module is enabled
|
||||
- Fixed a bug that prevented Enhanced Terrain Layer from determining dragged moving token
|
||||
- Fixed several deprecation warnings
|
||||
|
||||
### Translations
|
||||
- Updated the english text for several UI items
|
||||
- Updated the german translation
|
||||
- Updated the french translation (thanks rectulo!)
|
||||
|
||||
|
||||
## 1.13.0
|
||||
### Breaking changes
|
||||
- Drag Ruler's pathfinder has been extracted into a dedicated library module. If you'd like to continue to use Drag Ruler's pathfinding feature, please install [routinglib](https://foundryvtt.com/packages/routinglib) alongside Drag Ruler.
|
||||
|
||||
@@ -9,7 +9,7 @@ This module shows a ruler when you drag a token or measurement template to infor
|
||||
|
||||
|
||||
## Supports Tokens of all sizes
|
||||
Terrain ruler has excellent support for tokens of all sizes. The Ruler will always originate from the token's center and will always highlight all the squares that tokens move over. If the [Hex Token Size Support](https://foundryvtt.com/packages/hex-size-support) is installed this is also true for large tokens on hex scenes.
|
||||
Terrain ruler has excellent support for tokens of all sizes. The Ruler will always originate from the token's center and will always highlight all the squares that tokens move over.
|
||||
|
||||

|
||||

|
||||
@@ -39,7 +39,7 @@ When routinglib is installed, Drag Ruler can automatically place waypoints to wa
|
||||
|
||||
Pathfinding is restricted to GM users by default, since the pathfinding algorithm can create ways that lead through unexplored fog of war. If you want to allow your players to use Drag Ruler's pathfinding functionality, you need to enable the associated setting in Drag Ruler's module settings.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Game systems with Drag Ruler integration
|
||||
|
||||
+22
-14
@@ -4,7 +4,7 @@
|
||||
"ok": "OK",
|
||||
"terrain-ruler": {
|
||||
"title": "Wie man schwieriges Gelände mit Drag Ruler misst",
|
||||
"text": "Du hast das {moduleName} Modul installiert. Drag Ruler kann schwieriges Gelände, das mit diesem Modul platziert wurde in seinen Messungen berücksichtigen. Hierzu greift Drag Ruler auf die Funktionalität von Terrain Ruler zurück. Wenn Terrain Ruler installiert und aktiviert ist wird Drag Ruler automatisch anfangen schwieriges Gelände in den Messungen zu berücksichtigen.",
|
||||
"text": "Du hast das {moduleName} Modul installiert. Drag Ruler kann schwieriges Gelände, das mit diesem Modul platziert wurde in seinen Messungen berücksichtigen. Hierzu greift Drag Ruler auf die Funktionalität von Terrain Ruler zurück. Wenn Terrain Ruler installiert und aktiviert ist, wird Drag Ruler automatisch anfangen schwieriges Gelände in den Messungen zu berücksichtigen.",
|
||||
"neverShowAgain": "Zeige dies nie wieder an"
|
||||
},
|
||||
"socketlib": {
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"speedAttribute": {
|
||||
"name": "Geschwindigkeitsattribut",
|
||||
"hint": "Das Attribut, das die Gehgeschwindigkeit einer Spielfigur definiert. Diese Attribut wird während der Färbung des hervorgehobenen Pfads verwendet."
|
||||
"hint": "Das Attribut, das die Gehgeschwindigkeit einer Spielfigur definiert. Dieses Attribut wird während der Färbung des hervorgehobenen Pfads verwendet."
|
||||
}
|
||||
},
|
||||
"speeds": {
|
||||
@@ -35,7 +35,7 @@
|
||||
"deleteWaypoint": "Wegpunkt löschen",
|
||||
"disableSnap": {
|
||||
"name": "Raster deaktivieren",
|
||||
"hint": "Während diese Taste gedrückt ist wird das Raster temporär deaktiviert"
|
||||
"hint": "Während diese Taste gedrückt ist, wird das Raster temporär deaktiviert."
|
||||
},
|
||||
"moveWithoutAnimation": {
|
||||
"name": "Tokenanimation deaktivieren",
|
||||
@@ -43,25 +43,25 @@
|
||||
},
|
||||
"togglePathfinding": {
|
||||
"name": "Wegfindung umschalten",
|
||||
"hint": "Wenn diese Taste gedrückt gehalten wird, während ein Token gezogen wird, wird die Wegfindung vorübergehend aktiviert/deaktiviert"
|
||||
"hint": "Wenn diese Taste gedrückt gehalten wird, während ein Token gezogen wird, wird die Wegfindung vorübergehend aktiviert/deaktiviert."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"allowPathfinding": {
|
||||
"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."
|
||||
"hint": "Erlaubt es Spielern die Wegfindung 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",
|
||||
"hint": "Wenn diese Einstellung aktiviert ist wird die Färbung der hervorgehobenen Felder bei Spielercharakteren allen Spielern angezeigt, selbst wenn diese keinen Zugriff auf den Charakterbogen haben."
|
||||
"hint": "Wenn diese Einstellung aktiviert ist, wird die Färbung der hervorgehobenen Felder bei Spielercharakteren allen Spielern angezeigt, selbst wenn diese keinen Zugriff auf den Charakterbogen haben."
|
||||
},
|
||||
"autoStartMeasurement": {
|
||||
"name": "Automatisch mit Messen beginnen",
|
||||
"hint": "Wenn diese Option aktiviert ist beginnt Drag Ruler mit dem Messen sobald das Token bewegt wird. Wenn die Option deaktiviert ist bleibt Drag Ruler deaktiviert bis der Knopf zum platzieren eines Wegpunkts betätigt wird."
|
||||
"hint": "Wenn diese Option aktiviert ist beginnt Drag Ruler mit dem Messen, sobald das Token bewegt wird. Wenn die Option deaktiviert ist, bleibt Drag Ruler deaktiviert bis der Knopf zum Platzieren eines Wegpunkts betätigt wird."
|
||||
},
|
||||
"enableMovementHistory": {
|
||||
"name": "Bewegungsverlauf während des Kampfes aktivieren",
|
||||
"hint": "Wenn diesen Option aktiviert ist merkt sich Drag Ruler die Bewegungen, die während einer Runde eines Kampfes gemacht wurden und zeigt diese an, wenn das Token weiterbewegt wird."
|
||||
"hint": "Wenn diese Option aktiviert ist, merkt sich Drag Ruler die Bewegungen, die während einer Runde eines Kampfes gemacht wurden und zeigt diese an, wenn das Token weiterbewegt wird."
|
||||
},
|
||||
"rightClickAction": {
|
||||
"name": "Aktion bei Rechtsklick",
|
||||
@@ -74,7 +74,7 @@
|
||||
},
|
||||
"showGMRulerToPlayers": {
|
||||
"name": "Lineal des Spielleiters bei Spielern anzeigen",
|
||||
"hint": "Wenn diese Option deaktiviert ist wird das Lineal des Spielleiters bei den anderen Spielern nicht angezeigt."
|
||||
"hint": "Wenn diese Option deaktiviert ist, wird das Lineal des Spielleiters bei den anderen Spielern nicht angezeigt."
|
||||
},
|
||||
"speedProviderSettings": {
|
||||
"name": "Einstellungen zur Spielsystemintegration",
|
||||
@@ -87,20 +87,20 @@
|
||||
},
|
||||
"activeProvider": {
|
||||
"name": "Verwendete Spielsystemintegration",
|
||||
"hint": "Die unten angezeigten Einstellungen hängen von der verwendeten Spielsystemintegration ab. Wenn der Spielleiter eine andere Spielsystemintegration auswählt können sich die zur Verfügung stehenden Einstellungen ändern."
|
||||
"hint": "Die unten angezeigten Einstellungen hängen von der verwendeten Spielsystemintegration ab. Wenn der Spielleiter eine andere Spielsystemintegration auswählt, können sich die zur Verfügung stehenden Einstellungen ändern."
|
||||
},
|
||||
"noSettings": "Diese Spielsystemintegration hat keine Einstellmöglichkeiten",
|
||||
"noSettings": "Diese Spielsystemintegration hat keine Einstellmöglichkeiten.",
|
||||
"color": {
|
||||
"name": "Farbe für {colorName}",
|
||||
"hint": "Die Farbe mit der Felder in {colorName} Reichweite hervorgehoben werden",
|
||||
"hint": "Die Farbe mit der Felder in {colorName} Reichweite hervorgehoben werden.",
|
||||
"unreachable": {
|
||||
"name": "unerreichbar",
|
||||
"hint": "Die Farbe für Felder, die von der bewegten Spielfigur nicht erreicht werden können"
|
||||
"hint": "Die Farbe für Felder, die von der bewegten Spielfigur nicht erreicht werden können."
|
||||
}
|
||||
},
|
||||
"speedProvider": {
|
||||
"name": "Verwendete Spielsystemintegration",
|
||||
"hint": "Wähle aus, welche Spielsystemintegration für die farbliche Hervorhebung der Felder zuständig sein soll. Drag Ruler stellt eine generische Spielsystemintegration zur Verfügung, die grundlegende Funktionalität bietet und bei korrekter konfiguration mit allen Spielsystemen funktionieren sollte. Weitere Spielsystemintegrationen können durch Module und Spielsysteme angeboten werden. Eine andere Spielsystemintegration als die generische auszuwählen kann eine bessere Inegration in das verwendete Spielsystem bieten. Die Optionen unterhalb sind davon abhängig, welche Spielsystemintegration hier ausgewählt wurde.",
|
||||
"hint": "Wähle aus, welche Spielsystemintegration für die farbliche Hervorhebung der Felder zuständig sein soll. Drag Ruler stellt eine generische Spielsystemintegration zur Verfügung, die grundlegende Funktionalität bietet und bei korrekter Konfiguration mit allen Spielsystemen funktionieren sollte. Weitere Spielsystemintegrationen können durch Module und Spielsysteme angeboten werden. Eine andere Spielsystemintegration als die generische auszuwählen kann eine bessere Integration in das verwendete Spielsystem bieten. Die Optionen unterhalb sind davon abhängig, welche Spielsystemintegration hier ausgewählt wurde.",
|
||||
"choices": {
|
||||
"module": "Modul {name}",
|
||||
"native": "Generisch",
|
||||
@@ -111,6 +111,14 @@
|
||||
"useGridlessraster": {
|
||||
"name": "Geschwindigkeitsraster aktivieren",
|
||||
"hint": "Lässt Spielfiguren auf gitterlosen Szenen an deren Geschwindigkeitsgrenzen einrasten."
|
||||
},
|
||||
"autoPathfinding": {
|
||||
"name": "Wegfindung grundsätzlich aktivieren",
|
||||
"hint": "Wenn diese Option aktiviert ist, wird beim Ziehen eines Tokens automatisch die Wegfindung verwendet."
|
||||
},
|
||||
"useGridlessRaster": {
|
||||
"name": "Geschwindigkeitsbasiertes Raster verwenden",
|
||||
"hint": "Dies lässt Spielfiguren auf gitterlosen Szenen an ihren Geschwindigkeitsgrenzen einrasten."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -4,7 +4,7 @@
|
||||
"ok": "OK",
|
||||
"terrain-ruler": {
|
||||
"title": "How to measure difficult terrain with Drag Ruler",
|
||||
"text": "You have the {moduleName} module enabled. Drag Ruler is able to measure difficult terrain that was placed down using that module. To make this possible Drag Ruler utilizes the Terrain Ruler module. If Terrain Ruler is installed and activated Drag Ruler will automatically start to respect difficult terrain in it's measurements.",
|
||||
"text": "You have the {moduleName} module enabled. Drag Ruler is able to measure difficult terrain that was placed down using that module. To make this possible Drag Ruler utilizes the Terrain Ruler module. If Terrain Ruler is installed and activated Drag Ruler will automatically start to respect difficult terrain in its measurements.",
|
||||
"neverShowAgain": "Never show this again"
|
||||
},
|
||||
"socketlib": {
|
||||
@@ -12,7 +12,7 @@
|
||||
"text": "Drag Ruler requires the socketlib module to work properly. Please activate the socketlib module in this world."
|
||||
}
|
||||
},
|
||||
"resetMovementHistory": "Reset Movement History",
|
||||
"resetMovementHistory": "Reset movement history",
|
||||
"genericSpeedProvider": {
|
||||
"settings": {
|
||||
"dashMultiplier": {
|
||||
@@ -35,15 +35,15 @@
|
||||
"deleteWaypoint": "Delete waypoint",
|
||||
"disableSnap": {
|
||||
"name": "Disable snapping",
|
||||
"hint": "Snapping will be temporarily disabled while this key is being held down"
|
||||
"hint": "Snapping will be temporarily disabled while this key is being held down."
|
||||
},
|
||||
"moveWithoutAnimation": {
|
||||
"name": "Disable token animation",
|
||||
"hint": "When being held while dropping a token, the token will move to the target location without animating"
|
||||
"hint": "When being held while dropping a token, the token will move to the target location without animating."
|
||||
},
|
||||
"togglePathfinding": {
|
||||
"name": "Toggle pathfinding",
|
||||
"hint": "When being held while dragging a token, the pathfinding functionality will be temporarily enabled/disabled"
|
||||
"hint": "When being held while dragging a token, the pathfinding functionality will be temporarily enabled/disabled."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
@@ -53,7 +53,7 @@
|
||||
},
|
||||
"alwaysShowSpeedForPCs": {
|
||||
"name": "Show PC speed to everyone",
|
||||
"hint": "If enabled the coloring based on actor speed for player characters will shown to everyone, even if they don't have observer permission for the character sheet."
|
||||
"hint": "If enabled, the coloring based on actor speed for player characters will be shown to everyone, even if they don't have observer permission for the character sheet."
|
||||
},
|
||||
"autoStartMeasurement": {
|
||||
"name": "Automatically start measuring",
|
||||
@@ -61,15 +61,15 @@
|
||||
},
|
||||
"autoPathfinding": {
|
||||
"name": "Pathfinding by default",
|
||||
"hint": "If enabled, dragging a token will automatically use a pathfinding ruler"
|
||||
"hint": "If enabled, dragging a token will automatically use a pathfinding ruler."
|
||||
},
|
||||
"enableMovementHistory": {
|
||||
"name": "Enable movement history during combat",
|
||||
"hint": "If enabled, Drag Ruler will remember the path a token took during it's turn in combat and will display it when you pick the token back up."
|
||||
"hint": "If enabled, Drag Ruler will remember the path a token took during its turn in combat and will display it when you pick the token back up."
|
||||
},
|
||||
"rightClickAction": {
|
||||
"name": "Right click action",
|
||||
"hint": "What action shall be performed when right clicking while dragging a token?",
|
||||
"hint": "What action shall be performed when right-clicking while dragging a token?",
|
||||
"choices": {
|
||||
"create": "Create waypoint",
|
||||
"delete": "Delete waypoint",
|
||||
@@ -78,7 +78,7 @@
|
||||
},
|
||||
"showGMRulerToPlayers": {
|
||||
"name": "Show GM ruler to players",
|
||||
"hint": "If disabled the ruler of GMs will not be shown for non-GM players"
|
||||
"hint": "If disabled the ruler of GMs will not be shown for non-GM players."
|
||||
},
|
||||
"speedProviderSettings": {
|
||||
"name": "Speed Provider Settings",
|
||||
@@ -90,21 +90,21 @@
|
||||
"speedProviderSettings": "Speed Provider specific settings"
|
||||
},
|
||||
"activeProvider": {
|
||||
"name": "Currently active Speed Provider",
|
||||
"name": "Active Speed Provider",
|
||||
"hint": "The settings show below depend on the active speed provider. If the GM selects a different speed provider the available settings may change."
|
||||
},
|
||||
"noSettings": "This speed provider doesn't offer any configuration options.",
|
||||
"color": {
|
||||
"name": "Color for {colorName}",
|
||||
"hint": "The color that will be used to color squares that are within {colorName} range",
|
||||
"hint": "The color that will be used to color squares that are within {colorName} range.",
|
||||
"unreachable": {
|
||||
"name": "unreachable",
|
||||
"hint": "The color for spaces that aren't reachable by the dragged token"
|
||||
"hint": "The color for spaces that aren't reachable by the dragged token."
|
||||
}
|
||||
},
|
||||
"speedProvider": {
|
||||
"name": "Speed Settings Provider",
|
||||
"hint": "Select who provides speed information for tokens duing coloring. Drag Ruler offers a generic speed provider that provides basic functionality and should work for all game systems if configured correctly. More speed providers can be made available via game systems and installed modules. Selecting a different speed provider than the generic speed provider may offer a better integration into the rules of the game system you're using. The options below are dependent upon the speed provider selected here.",
|
||||
"hint": "Select who provides speed information for tokens during coloring. Drag Ruler offers a generic speed provider that provides basic functionality and should work for all game systems if configured correctly. More speed providers can be made available via game systems and installed modules. Selecting a different speed provider than the generic speed provider may offer a better integration into the rules of the game system you're using. The options below are dependent upon the speed provider selected here.",
|
||||
"choices": {
|
||||
"module": "Module {name}",
|
||||
"native": "Generic",
|
||||
|
||||
+49
-13
@@ -4,7 +4,7 @@
|
||||
"ok": "OK",
|
||||
"terrain-ruler": {
|
||||
"title": "Comment mesurer un terrain difficile avec Drag Ruler",
|
||||
"text": "Vous avez le module {moduleName} activé. Drag Ruler est capable de mesurer un terrain difficile qui a été placé à l'aide de ce module. Pour rendre cela possible, Drag Ruler utilise le module Terrain Ruler. Si Terrain Ruler est installé et activé Drag Ruler commencera automatiquement à respecter le terrain difficile dans ses mesures.",
|
||||
"text": "Vous avez le module {moduleName} activé. Drag Ruler est capable de mesurer un terrain difficile qui a été placé à l'aide de ce module. Pour rendre cela possible, Drag Ruler utilise le module Terrain Ruler. Si Terrain Ruler est installé et activé, Drag Ruler commencera automatiquement à respecter le terrain difficile lors de ses mesures.",
|
||||
"neverShowAgain": "Ne plus jamais afficher cela"
|
||||
},
|
||||
"socketlib": {
|
||||
@@ -16,19 +16,41 @@
|
||||
"genericSpeedProvider": {
|
||||
"settings": {
|
||||
"dashMultiplier": {
|
||||
"name": "Multiplicateur de courses",
|
||||
"name": "Multiplicateur de course",
|
||||
"hint": "Cela peut être utilisé pour donner aux jetons une vitesse secondaire pendant la coloration du chemin mesuré. Réglez-le sur 0 pour désactiver la vitesse secondaire."
|
||||
},
|
||||
"speedAttribute": {
|
||||
"name": "Attribut de vitesse",
|
||||
"hint": "L'attribut qui définit la vitesse de marche d'un jeton. Il est utilisé lors de la coloration du chemin mesuré." }
|
||||
"hint": "L'attribut qui définit la vitesse de marche d'un jeton. Il est utilisé lors de la coloration du chemin mesuré."
|
||||
}
|
||||
},
|
||||
"speeds": {
|
||||
"walk": "marche",
|
||||
"dash": "course"
|
||||
}
|
||||
},
|
||||
"keybindings": {
|
||||
"cancelDrag": "Effacer glisser",
|
||||
"createWaypoint": "Créer un point de passage",
|
||||
"deleteWaypoint": "Effacer un point de passage",
|
||||
"disableSnap": {
|
||||
"name": "Désactiver l'interruption",
|
||||
"hint": "L'interruption sera temporairement désactivée tant que cette clé est maintenue enfoncée."
|
||||
},
|
||||
"moveWithoutAnimation": {
|
||||
"name": "Désactiver l'animation du jeton",
|
||||
"hint": "Lorsqu'elle est maintenue lorsque vous déposer un jeton, le jeton se déplacera vers le lieu ciblé sans s'animer."
|
||||
},
|
||||
"togglePathfinding": {
|
||||
"name": "Activer la recherche de l'itinéraire",
|
||||
"hint": "Lorsqu'elle est maintenue en glissant un jeton, la fonction de recherche de l'itinéraire sera temporairement activée/désactivée."
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"allowPathfinding": {
|
||||
"name": "Autoriser la recherche de l'itinéraire pour les joueurs",
|
||||
"hint": "Permet aux joueurs d'utiliser la fonction de recherche de l'itinéraire de Drag Ruler dans ce monde. Soyez conscient que la recherche de l'itinéraire peut conduire à travers le brouillard de guerre inexploré et les murs éthérés, ce qui pourrait révéler des secrets à vos joueurs avant l'heure."
|
||||
},
|
||||
"alwaysShowSpeedForPCs": {
|
||||
"name": "Afficher la vitesse du PJ à tout le monde",
|
||||
"hint": "Si activé, la coloration basée sur la vitesse de l'acteur pour les personnages joueurs sera montrée à tout le monde, même s'ils n'ont pas la permission d'observateur pour la feuille de personnage."
|
||||
@@ -37,13 +59,26 @@
|
||||
"name": "Démarrer automatiquement la mesure",
|
||||
"hint": "Si activé, Drag Ruler commencera à mesurer dès que le jeton est glissé. S'il est désactivé, Drag Ruler restera inactif et ne commencera à mesurer qu'une fois que le bouton pour ajouter un waypoint est enfoncé."
|
||||
},
|
||||
"autoPathfinding": {
|
||||
"name": "Recherche d'itinéraire par défaut",
|
||||
"hint": "Si activé, glisser un jeton utilisera automatiquement une recherche de l'itinéraire."
|
||||
},
|
||||
"enableMovementHistory": {
|
||||
"name": "Activer l'historique des mouvements pendant le combat",
|
||||
"hint": "Si activé, Drag Ruler se souviendra du chemin emprunté par un jeton pendant son tour de combat et l'affichera lorsque vous récupérerez le jeton."
|
||||
},
|
||||
"rightClickAction": {
|
||||
"name": "action de Clic droit",
|
||||
"hint": "Quelle sera l'action accomplie lorsque vous ferez un clic droit en glissant un jeton ?",
|
||||
"choices": {
|
||||
"create": "Créer un point de passage",
|
||||
"delete": "Effacer un point de passage",
|
||||
"cancel": "Annuler le glisser"
|
||||
}
|
||||
},
|
||||
"showGMRulerToPlayers": {
|
||||
"name": "Afficher la règle MJ aux joueurs",
|
||||
"hint": "Si désactivé, la règle des MJ ne sera pas affichée pour les joueurs non-MJ"
|
||||
"hint": "Si désactivé, la règle des MJ ne sera pas affichée pour les joueurs non MJ."
|
||||
},
|
||||
"speedProviderSettings": {
|
||||
"name": "Paramètres du système de vitesse",
|
||||
@@ -51,35 +86,36 @@
|
||||
"button": "Paramètres du système de vitesse",
|
||||
"windowTitle": "Paramètres du système de vitesse",
|
||||
"headers": {
|
||||
"speedProvider": "système de vitesse",
|
||||
"speedProvider": "Système de vitesse",
|
||||
"speedProviderSettings": "Paramètres spécifiques au système de vitesse"
|
||||
},
|
||||
"activeProvider": {
|
||||
"name": "système de vitesse actuellement actif",
|
||||
"name": "Système de vitesse actuellement actif",
|
||||
"hint": "Les paramètres indiqués ci-dessous dépendent du système de vitesse actif. Si le MJ sélectionne un système de vitesse différent, les paramètres disponibles peuvent changer."
|
||||
},
|
||||
"noSettings": "Ce système de vitesse n'offre aucune option de configuration.",
|
||||
"color": {
|
||||
"name": "Couleur pour {colorName}",
|
||||
"hint": "La couleur qui sera utilisée pour colorier les carrés qui sont dans la plage {colorName}",
|
||||
"hint": "La couleur qui sera utilisée pour colorier les carrés qui sont dans la portée {colorName}.",
|
||||
"unreachable": {
|
||||
"name": "injoignable",
|
||||
"hint": "La couleur des espaces qui ne sont pas accessibles par le jeton déplacé"
|
||||
"name": "inaccessible",
|
||||
"hint": "La couleur des cases qui ne sont pas accessibles pour le jeton déplacé."
|
||||
}
|
||||
},
|
||||
"speedProvider": {
|
||||
"name": "système de paramètres de vitesse",
|
||||
"name": "Système de paramètres de vitesse",
|
||||
"indice": "Sélectionnez qui fournit les informations de vitesse pour les jetons lors de la coloration. Drag Ruler offre un système de vitesse générique qui fournit des fonctionnalités de base et devrait fonctionner pour tous les systèmes de jeu s'il est correctement configuré. Plus de systèmes de vitesse peuvent être mis à disposition via les systèmes de jeu et les modules installés. La sélection d'un autre système de vitesse que le système de vitesse générique peut offrir une meilleure intégration dans les règles du système de jeu que vous utilisez. Les options ci-dessous dépendent du système de vitesse sélectionné ici.",
|
||||
"choices": {
|
||||
"module": "Module {name}",
|
||||
"native": "Générique",
|
||||
"system": "Systéme {name}"
|
||||
}
|
||||
},
|
||||
"hint": "Choisissez qui fournit les informations de vitesse pour les jetons lors de la coloration. Drag Ruler propose un fournisseur de vitesse générique qui offre une fonctionnalité de base qui devrait fonctionner pour tous les systèmes de jeu s'il est correctement configuré. D'autres fournisseurs de vitesse peuvent être mis à disposition par les systèmes de jeu et les modules installés. Le choix d'un fournisseur de vitesse différent du fournisseur de vitesse générique peut offrir une meilleure intégration des règles du système de jeu que vous utilisez. Les options ci-dessous dépendent du fournisseur de vitesse sélectionné ici."
|
||||
}
|
||||
},
|
||||
"useGridlessRaster": {
|
||||
"name": "Use speed based snapping",
|
||||
"hint": "On Gridless scenes, this makes tokens snap to the token's speed ranges. This can be temporarily disabled by pressing Shift during drag."
|
||||
"name": "Utilise l'interruption basée sur la vitesse",
|
||||
"hint": "Sur des scènes sans grilles, cela permet aux jetons de s'interrompre à la portée de leur vitesse. Cela peut être temporairement désactivé en pressant Shift en faisant glisser."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
"id": "drag-ruler",
|
||||
"title": "Drag Ruler",
|
||||
"description": "When dragging a token displays a ruler showing how far you've moved that token.",
|
||||
"version": "1.13.0",
|
||||
"version": "1.13.2",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10"
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
"socket": true,
|
||||
"url": "https://github.com/manuelVo/foundryvtt-drag-ruler",
|
||||
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.13.0.zip",
|
||||
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.13.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",
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ export function buildCostFunction(token, shape) {
|
||||
return (x, y, costOptions = {}) => {
|
||||
costOptions.token = token;
|
||||
const area = getAreaFromPositionAndShape({x, y}, shape);
|
||||
const costs = area.map(space => canvas.terrain.cost({x: space.x, y: space.y, costOptions}));
|
||||
const costs = area.map(space => canvas.terrain.cost({x: space.x, y: space.y}, costOptions));
|
||||
return costs.reduce((max, current) => Math.max(max, current));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,11 +2,6 @@ import {buildCostFunction} from "./api.js";
|
||||
import {settingsKey} from "./settings.js";
|
||||
import {highlightTokenShape} from "./util.js";
|
||||
|
||||
export function getHexSizeSupportTokenGridCenter(token) {
|
||||
const tokenCenterOffset = CONFIG.hexSizeSupport.getCenterOffset(token);
|
||||
return {x: token.x + tokenCenterOffset.x, y: token.y + tokenCenterOffset.y};
|
||||
}
|
||||
|
||||
export function highlightMeasurementTerrainRuler(
|
||||
ray,
|
||||
startDistance,
|
||||
|
||||
+5
-5
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
export function findVertexSnapPoint(x, y, altOrientationFlag) {
|
||||
const grid = canvas.grid.grid;
|
||||
if (grid.columns) {
|
||||
if (grid.columnar) {
|
||||
return findSnapPointCols(x, y, grid.h, grid.w, altOrientationFlag);
|
||||
} else {
|
||||
return findSnapPointRows(x, y, grid.h, grid.w, altOrientationFlag);
|
||||
@@ -59,11 +59,11 @@ function findSnapPointCols(x, y, h, w, alt) {
|
||||
yOffset = -0.5;
|
||||
}
|
||||
|
||||
let xOffset1 = 0.25;
|
||||
let xOffset2 = 1.0;
|
||||
let xOffset1 = 0.75;
|
||||
let xOffset2 = 0.0;
|
||||
if (alt) {
|
||||
xOffset1 = 0.75;
|
||||
xOffset2 = 0.0;
|
||||
xOffset1 = 0.25;
|
||||
xOffset2 = 1.0;
|
||||
}
|
||||
|
||||
let row1 = calculateSnapPointsCols(x, y, h, w, xOffset1, 0.5 + yOffset);
|
||||
|
||||
+4
-11
@@ -8,7 +8,7 @@ import {
|
||||
registerModule,
|
||||
registerSystem,
|
||||
} from "./api.js";
|
||||
import {checkDependencies, getHexSizeSupportTokenGridCenter} from "./compatibility.js";
|
||||
import {checkDependencies} from "./compatibility.js";
|
||||
import {moveEntities, onMouseMove} from "./foundry_imports.js";
|
||||
import {disableSnap, registerKeybindings} from "./keybindings.js";
|
||||
import {libWrapper} from "./libwrapper_shim.js";
|
||||
@@ -18,7 +18,7 @@ import {extendRuler} from "./ruler.js";
|
||||
import {registerSettings, RightClickAction, settingsKey} from "./settings.js";
|
||||
import {recalculate} from "./socket.js";
|
||||
import {SpeedProvider} from "./speed_provider.js";
|
||||
import {setSnapParameterOnOptions} from "./util.js";
|
||||
import {getEntityCenter, setSnapParameterOnOptions} from "./util.js";
|
||||
|
||||
CONFIG.debug.dragRuler = false;
|
||||
export let debugGraphics = undefined;
|
||||
@@ -39,6 +39,7 @@ Hooks.once("init", () => {
|
||||
extendRuler();
|
||||
|
||||
window.dragRuler = {
|
||||
getRangesFromSpeedProvider,
|
||||
getColorForDistanceAndToken,
|
||||
getMovedDistanceFromToken,
|
||||
registerModule,
|
||||
@@ -135,15 +136,7 @@ function onEntityLeftDragStart(wrapped, event) {
|
||||
const isToken = this instanceof Token;
|
||||
const ruler = canvas.controls.ruler;
|
||||
ruler.draggedEntity = this;
|
||||
let entityCenter;
|
||||
if (
|
||||
isToken &&
|
||||
canvas.grid.isHex &&
|
||||
game.modules.get("hex-size-support")?.active &&
|
||||
CONFIG.hexSizeSupport.getAltSnappingFlag(this)
|
||||
)
|
||||
entityCenter = getHexSizeSupportTokenGridCenter(this);
|
||||
else entityCenter = this.center;
|
||||
const entityCenter = getEntityCenter(this);
|
||||
ruler.rulerOffset = {
|
||||
x: entityCenter.x - event.data.origin.x,
|
||||
y: entityCenter.y - event.data.origin.y,
|
||||
|
||||
@@ -4,13 +4,13 @@ import {getTokenShape, isClose, zip} from "./util.js";
|
||||
|
||||
function initTrackingFlag(combatant) {
|
||||
const initialFlag = {passedWaypoints: [], trackedRound: 0};
|
||||
let dragRulerFlag = combatant.data.flags.dragRuler;
|
||||
let dragRulerFlag = combatant.flags.dragRuler;
|
||||
if (dragRulerFlag) {
|
||||
if (isNaN(dragRulerFlag.trackedRound)) {
|
||||
mergeObject(dragRulerFlag, initialFlag);
|
||||
}
|
||||
} else {
|
||||
combatant.data.flags.dragRuler = initialFlag;
|
||||
combatant.flags.dragRuler = initialFlag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,14 +40,14 @@ function calculateUpdate(combat, token, rays) {
|
||||
if (!combatant) return;
|
||||
|
||||
// Check if we have entered a new round. If so, remove the currently stored path
|
||||
if (combat.data.round > combatant.data.flags.dragRuler.trackedRound) {
|
||||
combatant.data.flags.dragRuler.passedWaypoints = [];
|
||||
combatant.data.flags.dragRuler.trackedRound = combat.data.round;
|
||||
if (combat.round > combatant.flags.dragRuler.trackedRound) {
|
||||
combatant.flags.dragRuler.passedWaypoints = [];
|
||||
combatant.flags.dragRuler.trackedRound = combat.round;
|
||||
}
|
||||
|
||||
// Add the passed waypoints to the combatant
|
||||
const terrainRulerAvailable = game.modules.get("terrain-ruler")?.active;
|
||||
const dragRulerFlags = combatant.data.flags.dragRuler;
|
||||
const dragRulerFlags = combatant.flags.dragRuler;
|
||||
const waypoints = dragRulerFlags.passedWaypoints;
|
||||
for (const ray of rays) {
|
||||
// Ignore rays that have the same start and end coordinates
|
||||
@@ -88,13 +88,13 @@ export async function removeLastHistoryEntryIfAt(token, x, y) {
|
||||
const combat = game.combat;
|
||||
const combatant = combat.getCombatantByToken(token.id);
|
||||
await updateCombatantDragRulerFlags(combat, [
|
||||
{_id: combatant.id, dragRulerFlags: combatant.data.flags.dragRuler},
|
||||
{_id: combatant.id, dragRulerFlags: combatant.flags.dragRuler},
|
||||
]);
|
||||
}
|
||||
|
||||
export async function resetMovementHistory(combat, combatantId) {
|
||||
const combatant = combat.combatants.get(combatantId);
|
||||
const dragRulerFlags = combatant.data.flags.dragRuler;
|
||||
const dragRulerFlags = combatant.flags.dragRuler;
|
||||
if (!dragRulerFlags) return;
|
||||
dragRulerFlags.passedWaypoints = null;
|
||||
dragRulerFlags.trackedRound = null;
|
||||
|
||||
+4
-15
@@ -3,11 +3,7 @@ import {
|
||||
getColorForDistanceAndToken,
|
||||
getRangesFromSpeedProvider,
|
||||
} from "./api.js";
|
||||
import {
|
||||
getHexSizeSupportTokenGridCenter,
|
||||
highlightMeasurementTerrainRuler,
|
||||
measureDistances,
|
||||
} from "./compatibility.js";
|
||||
import {highlightMeasurementTerrainRuler, measureDistances} from "./compatibility.js";
|
||||
import {getGridPositionFromPixelsObj, getPixelsFromGridPositionObj} from "./foundry_fixes.js";
|
||||
import {cancelScheduledMeasurement, highlightMeasurementNative} from "./foundry_imports.js";
|
||||
import {disableSnap} from "./keybindings.js";
|
||||
@@ -17,6 +13,7 @@ import {
|
||||
applyTokenSizeOffset,
|
||||
getSnapPointForEntity,
|
||||
getSnapPointForTokenObj,
|
||||
getEntityCenter,
|
||||
getTokenShape,
|
||||
isPathfindingEnabled,
|
||||
} from "./util.js";
|
||||
@@ -460,7 +457,7 @@ export function extendRuler() {
|
||||
// If this is a pc and alwaysShowSpeedForPCs is enabled we show the color anyway
|
||||
if (
|
||||
!(
|
||||
this.draggedEntity.actor.data.type === "character" &&
|
||||
this.draggedEntity.actor.type === "character" &&
|
||||
game.settings.get(settingsKey, "alwaysShowSpeedForPCs")
|
||||
)
|
||||
)
|
||||
@@ -482,15 +479,7 @@ export function extendRuler() {
|
||||
const ruler = canvas.controls.ruler;
|
||||
ruler.clear();
|
||||
ruler._state = Ruler.STATES.STARTING;
|
||||
let entityCenter;
|
||||
if (
|
||||
isToken &&
|
||||
canvas.grid.isHex &&
|
||||
game.modules.get("hex-size-support")?.active &&
|
||||
CONFIG.hexSizeSupport.getAltSnappingFlag(entity)
|
||||
)
|
||||
entityCenter = getHexSizeSupportTokenGridCenter(entity);
|
||||
else entityCenter = entity.center;
|
||||
const entityCenter = getEntityCenter(this.draggedEntity);
|
||||
if (isToken && game.settings.get(settingsKey, "enableMovementHistory"))
|
||||
ruler.dragRulerAddWaypointHistory(getMovementHistory(entity));
|
||||
ruler.dragRulerAddWaypoint(entityCenter, {snap: false});
|
||||
|
||||
+2
-2
@@ -176,9 +176,9 @@ class SpeedProviderSettings extends FormApplication {
|
||||
} else {
|
||||
let name;
|
||||
if (type === "module") {
|
||||
name = game.modules.get(id).data.title;
|
||||
name = game.modules.get(id).title;
|
||||
} else {
|
||||
name = game.system.data.title;
|
||||
name = game.system.title;
|
||||
}
|
||||
provider.selectTitle = game.i18n.format(
|
||||
`drag-ruler.settings.speedProviderSettings.speedProvider.choices.${type}`,
|
||||
|
||||
+73
-63
@@ -27,83 +27,101 @@ export function sum(arr) {
|
||||
return arr.reduce((a, b) => a + b, 0);
|
||||
}
|
||||
|
||||
export function buildSnapPointTokenData(token) {
|
||||
const tokenData = {
|
||||
width: token.document.width,
|
||||
height: token.document.height,
|
||||
};
|
||||
|
||||
if (isModuleActive("hex-size-support")) {
|
||||
tokenData.hexSizeSupport = {};
|
||||
tokenData.hexSizeSupport.altSnappingFlag = CONFIG.hexSizeSupport.getAltSnappingFlag(token);
|
||||
tokenData.hexSizeSupport.altOrientationFlag =
|
||||
CONFIG.hexSizeSupport.getAltOrientationFlag(token);
|
||||
tokenData.hexSizeSupport.borderSize = token.document.getFlag("hex-size-support", "borderSize");
|
||||
// A copy of this function lives in the routinglib module
|
||||
export function getHexTokenSize(token) {
|
||||
const size = token.document.width;
|
||||
if (token.document.height !== size) {
|
||||
return 1;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
return tokenData;
|
||||
export function getEntityCenter(token) {
|
||||
if (token instanceof Token && canvas.grid.isHex) {
|
||||
const center = token.center;
|
||||
const size = getHexTokenSize(token);
|
||||
if (size % 2 === 0) {
|
||||
let offset;
|
||||
if (canvas.grid.grid.columnar) {
|
||||
offset = canvas.grid.grid.w - canvas.grid.grid.h;
|
||||
} else {
|
||||
offset = canvas.grid.grid.h - canvas.grid.grid.w;
|
||||
}
|
||||
if (getAltOrientationFlagForToken(token, size)) {
|
||||
offset *= -1;
|
||||
}
|
||||
if (canvas.grid.grid.columnar) {
|
||||
center.x -= offset;
|
||||
return center;
|
||||
} else {
|
||||
center.y -= offset;
|
||||
return center;
|
||||
}
|
||||
}
|
||||
}
|
||||
return token.center;
|
||||
}
|
||||
|
||||
export function getSnapPointForToken(x, y, token) {
|
||||
return getSnapPointForTokenData(x, y, buildSnapPointTokenData(token));
|
||||
// A copy of this function lives in the routinglib module
|
||||
export function getAltOrientationFlagForToken(token, size) {
|
||||
const hexSizeSupport = game.modules.get("hex-size-support")?.api;
|
||||
if (hexSizeSupport) {
|
||||
return hexSizeSupport.isAltOrientation(token);
|
||||
}
|
||||
|
||||
export function getSnapPointForTokenDataObj(pos, tokenData) {
|
||||
return getSnapPointForTokenData(pos.x, pos.y, tokenData);
|
||||
// In native foundry, tokens of size 2 are oriented like the "alt orientation" from hex-size-support
|
||||
// Tokens of size 4 are oriented like alt orientation wasn't set
|
||||
return size === 2;
|
||||
}
|
||||
|
||||
// A copy of this function lives in the librouting module
|
||||
function getSnapPointForTokenData(x, y, tokenData) {
|
||||
export function getSnapPointForToken(x, y, token) {
|
||||
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS) {
|
||||
return new PIXI.Point(x, y);
|
||||
return {x, y};
|
||||
}
|
||||
|
||||
if (canvas.grid.isHex) {
|
||||
if (tokenData.hexSizeSupport?.altSnappingFlag) {
|
||||
if (tokenData.hexSizeSupport.borderSize % 2 === 0) {
|
||||
const snapPoint = findVertexSnapPoint(x, y, tokenData.hexSizeSupport.altOrientationFlag);
|
||||
return new PIXI.Point(snapPoint.x, snapPoint.y);
|
||||
} else {
|
||||
return new PIXI.Point(...canvas.grid.getCenter(x, y));
|
||||
}
|
||||
} else {
|
||||
return new PIXI.Point(...canvas.grid.getCenter(x, y));
|
||||
const size = getHexTokenSize(token);
|
||||
if (size % 2 === 0) {
|
||||
return findVertexSnapPoint(x, y, getAltOrientationFlagForToken(token, size));
|
||||
}
|
||||
const [snapX, snapY] = canvas.grid.getCenter(x, y);
|
||||
return {x: snapX, y: snapY};
|
||||
}
|
||||
|
||||
const [topLeftX, topLeftY] = canvas.grid.getTopLeft(x, y);
|
||||
let cellX, cellY;
|
||||
if (tokenData.width % 2 === 0) cellX = x - canvas.grid.h / 2;
|
||||
if (token.document.width % 2 === 0) cellX = x - canvas.grid.h / 2;
|
||||
else cellX = x;
|
||||
if (tokenData.height % 2 === 0) cellY = y - canvas.grid.h / 2;
|
||||
if (token.document.height % 2 === 0) cellY = y - canvas.grid.h / 2;
|
||||
else cellY = y;
|
||||
const [centerX, centerY] = canvas.grid.getCenter(cellX, cellY);
|
||||
let snapX, snapY;
|
||||
// Tiny tokens can snap to the cells corners
|
||||
if (tokenData.width <= 0.5) {
|
||||
if (token.document.width <= 0.5) {
|
||||
const offsetX = x - topLeftX;
|
||||
const subGridWidth = Math.floor(canvas.grid.w / 2);
|
||||
const subGridPosX = Math.floor(offsetX / subGridWidth);
|
||||
snapX = topLeftX + (subGridPosX + 0.5) * subGridWidth;
|
||||
}
|
||||
// Tokens with odd multipliers (1x1, 3x3, ...) and tokens smaller than 1x1 but bigger than 0.5x0.5 snap to the center of the grid cell
|
||||
else if (Math.round(tokenData.width) % 2 === 1 || tokenData.width < 1) {
|
||||
else if (Math.round(token.document.width) % 2 === 1 || token.document.width < 1) {
|
||||
snapX = centerX;
|
||||
}
|
||||
// All remaining tokens (those with even or fractional multipliers on square grids) snap to the intersection points of the grid
|
||||
else {
|
||||
snapX = centerX + canvas.grid.w / 2;
|
||||
}
|
||||
if (tokenData.height <= 0.5) {
|
||||
if (token.document.height <= 0.5) {
|
||||
const offsetY = y - topLeftY;
|
||||
const subGridHeight = Math.floor(canvas.grid.h / 2);
|
||||
const subGridPosY = Math.floor(offsetY / subGridHeight);
|
||||
snapY = topLeftY + (subGridPosY + 0.5) * subGridHeight;
|
||||
} else if (Math.round(tokenData.height) % 2 === 1 || tokenData.height < 1) {
|
||||
} else if (Math.round(token.document.height) % 2 === 1 || token.document.height < 1) {
|
||||
snapY = centerY;
|
||||
} else {
|
||||
snapY = centerY + canvas.grid.h / 2;
|
||||
}
|
||||
return new PIXI.Point(snapX, snapY);
|
||||
return {x: snapX, y: snapY};
|
||||
}
|
||||
|
||||
export function getSnapPointForTokenObj(pos, token) {
|
||||
@@ -141,7 +159,7 @@ export function getAreaFromPositionAndShape(position, shape) {
|
||||
let shiftedRow;
|
||||
if (canvas.grid.grid.options.even) shiftedRow = 1;
|
||||
else shiftedRow = 0;
|
||||
if (canvas.grid.grid.options.columns) {
|
||||
if (canvas.grid.grid.columnar) {
|
||||
if (space.x % 2 !== 0 && position.x % 2 !== shiftedRow) {
|
||||
y += 1;
|
||||
}
|
||||
@@ -155,41 +173,38 @@ export function getAreaFromPositionAndShape(position, shape) {
|
||||
});
|
||||
}
|
||||
|
||||
// A copy of this function lives in the routinglib module
|
||||
export function getTokenShape(token) {
|
||||
return getTokenShapeForTokenData(buildSnapPointTokenData(token), token.scene);
|
||||
}
|
||||
|
||||
export function getTokenShapeForTokenData(tokenData, scene = canvas.scene) {
|
||||
let scene = canvas.scene;
|
||||
if (scene.grid.type === CONST.GRID_TYPES.GRIDLESS) {
|
||||
return [{x: 0, y: 0}];
|
||||
} else if (scene.grid.type === CONST.GRID_TYPES.SQUARE) {
|
||||
const topOffset = -Math.floor(tokenData.height / 2);
|
||||
const leftOffset = -Math.floor(tokenData.width / 2);
|
||||
const topOffset = -Math.floor(token.document.height / 2);
|
||||
const leftOffset = -Math.floor(token.document.width / 2);
|
||||
const shape = [];
|
||||
for (let y = 0; y < tokenData.height; y++) {
|
||||
for (let x = 0; x < tokenData.width; x++) {
|
||||
for (let y = 0; y < token.document.height; y++) {
|
||||
for (let x = 0; x < token.document.width; x++) {
|
||||
shape.push({x: x + leftOffset, y: y + topOffset});
|
||||
}
|
||||
}
|
||||
return shape;
|
||||
} else {
|
||||
// Hex grids
|
||||
if (game.modules.get("hex-size-support")?.active && tokenData.hexSizeSupport.altSnappingFlag) {
|
||||
const borderSize = tokenData.hexSizeSupport.borderSize;
|
||||
const size = getHexTokenSize(token);
|
||||
let shape = [{x: 0, y: 0}];
|
||||
if (borderSize >= 2)
|
||||
if (size >= 2)
|
||||
shape = shape.concat([
|
||||
{x: 0, y: -1},
|
||||
{x: -1, y: -1},
|
||||
]);
|
||||
if (borderSize >= 3)
|
||||
if (size >= 3)
|
||||
shape = shape.concat([
|
||||
{x: 0, y: 1},
|
||||
{x: -1, y: 1},
|
||||
{x: -1, y: 0},
|
||||
{x: 1, y: 0},
|
||||
]);
|
||||
if (borderSize >= 4)
|
||||
if (size >= 4)
|
||||
shape = shape.concat([
|
||||
{x: -2, y: -1},
|
||||
{x: 1, y: -1},
|
||||
@@ -198,24 +213,21 @@ export function getTokenShapeForTokenData(tokenData, scene = canvas.scene) {
|
||||
{x: 1, y: -2},
|
||||
]);
|
||||
|
||||
if (Boolean(tokenData.hexSizeSupport.altOrientationFlag) !== canvas.grid.grid.options.columns)
|
||||
if (getAltOrientationFlagForToken(token, size)) {
|
||||
shape.forEach(space => (space.y *= -1));
|
||||
if (canvas.grid.grid.options.columns)
|
||||
}
|
||||
if (canvas.grid.grid.columnar)
|
||||
shape = shape.map(space => {
|
||||
return {x: space.y, y: space.x};
|
||||
});
|
||||
return shape;
|
||||
} else {
|
||||
return [{x: 0, y: 0}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getTokenSize(token) {
|
||||
let w, h;
|
||||
const hexSizeSupportBorderSize = token.document.flags["hex-size-support"]?.borderSize;
|
||||
if (hexSizeSupportBorderSize > 0) {
|
||||
w = h = hexSizeSupportBorderSize;
|
||||
if (canvas.grid.isHex) {
|
||||
w = h = getHexTokenSize(token);
|
||||
} else {
|
||||
w = token.document.width;
|
||||
h = token.document.height;
|
||||
@@ -233,12 +245,11 @@ export function applyTokenSizeOffset(waypoints, token) {
|
||||
const tokenSize = getTokenSize(token);
|
||||
const waypointOffset = {x: 0, y: 0};
|
||||
if (canvas.grid.isHex) {
|
||||
if (game.modules.get("hex-size-support")?.active) {
|
||||
const isAltOrientation = CONFIG.hexSizeSupport.getAltOrientationFlag(token);
|
||||
if (canvas.grid.grid.options.columns) {
|
||||
const isAltOrientation = getAltOrientationFlagForToken(token, getHexTokenSize(token));
|
||||
if (canvas.grid.grid.columnar) {
|
||||
if (tokenSize.w % 2 === 0) {
|
||||
waypointOffset.x = canvas.grid.w / 2;
|
||||
if (!isAltOrientation) waypointOffset.x *= -1;
|
||||
if (isAltOrientation) waypointOffset.x *= -1;
|
||||
}
|
||||
} else {
|
||||
if (tokenSize.h % 2 === 0) {
|
||||
@@ -246,7 +257,6 @@ export function applyTokenSizeOffset(waypoints, token) {
|
||||
if (isAltOrientation) waypointOffset.y *= -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If hex size support isn't active leave the waypoints like they are
|
||||
} else {
|
||||
if (tokenSize.w % 2 === 0) {
|
||||
|
||||
Reference in New Issue
Block a user