generated from League-of-Foundry-Developers/FoundryVTT-Module-Template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.7.4' into main
- Loading branch information
Showing
11 changed files
with
675 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* globals | ||
*/ | ||
/* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ | ||
|
||
import { elevationAtWaypoint } from "./segments.js"; | ||
|
||
// Patches for the ClientKeybindings class | ||
export const PATCHES = {}; | ||
PATCHES.TOKEN_RULER = {}; // Assume this patch is only present if the token ruler setting is enabled. | ||
|
||
/** | ||
* Mixed wrap of ClientKeybindings._onMeasuredRulerMovement | ||
* Called when spacebar is pressed, for ruler. | ||
* If the Token Ruler is active, call that instead. | ||
* @param {KeyboardEventContext} context The context data of the event | ||
*/ | ||
async function _onMeasuredRulerMovement(wrapped, context) { | ||
console.log("_onMeasuredRulerMovement"); | ||
// We only care about when tokens are being dragged | ||
const ruler = canvas.controls.ruler; | ||
if ( !ruler.active | ||
|| !canvas.tokens.active | ||
|| ui.controls.tool !== "select" ) return wrapped(context); | ||
|
||
// For each controlled token, end the drag. | ||
canvas.tokens.clearPreviewContainer(); | ||
await ruler.moveToken(); | ||
ruler._endMeasurement(); | ||
} | ||
|
||
PATCHES.TOKEN_RULER.STATIC_WRAPS = { _onMeasuredRulerMovement } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* globals | ||
canvas | ||
*/ | ||
/* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ | ||
|
||
// Patches for the Token class | ||
export const PATCHES = {}; | ||
PATCHES.TOKEN_RULER = {}; // Assume this patch is only present if the token ruler setting is enabled. | ||
|
||
|
||
function _onDragLeftStart(wrapped, event) { | ||
console.log("Placeable.prototype._onDragLeftStart"); | ||
} | ||
|
||
PATCHES.TOKEN_RULER = { _onDragLeftStart }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.