Skip to content

Commit 52245f1

Browse files
committed
# Changelog
Version 1.0.8 GMs can move tokens at any time. Notification for users trying to move token whilst the game is paused. Camera movement should no longer happen when the game is paused.
1 parent 8e56a00 commit 52245f1

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

module.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "rtscontrols",
33
"title": "RTS Controls",
44
"description": "This module will attempt to add RTS like controls to token movement using the Routinglib library.",
5-
"version": "#{VERSION}#",
5+
"version": "1.0.7",
66
"library": "false",
77
"manifestPlusVersion": "1.2.0",
88
"compatibility": {
@@ -43,9 +43,9 @@
4343
"path": "languages/en.json"
4444
}
4545
],
46-
"url": "#{URL}#",
47-
"manifest": "#{MANIFEST}#",
48-
"download": "#{DOWNLOAD}#",
46+
"url": "https://github.com/Garsondee/RTSControls",
47+
"manifest": "https://github.com/Garsondee/RTSControls/releases/download/1.0.7/module.json",
48+
"download": "https://github.com/Garsondee/RTSControls/releases/download/1.0.7/module.zip",
4949
"license": "LICENSE",
5050
"readme": "README.md",
5151
"media": [

scripts/module.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ class MovementManager {
221221
color: movementColor,
222222
};
223223

224+
// If the user is a GM then overide the 'isPaused' to always = false
225+
if (game.user.isGM) {
226+
movement.isPaused = false;
227+
}
228+
224229
this.movements.set(token.id, movement);
225230
console.log(`Movement object created for token ${token.name}:`, movement);
226231

@@ -231,8 +236,8 @@ class MovementManager {
231236
}
232237

233238
tick() {
234-
// Check if the game is paused and return early if it is
235-
if (game.paused) {
239+
// If the game is paused and the user isn't a GM then return early
240+
if (game.paused && !game.user.isGM) {
236241
console.log('Game is paused, skipping tick.');
237242
return;
238243
}
@@ -429,6 +434,13 @@ class MovementManager {
429434
return;
430435
}
431436

437+
// If the game is paused then return early unless the user is has GM access
438+
if (game.paused && !game.user.isGM) {
439+
ui.notifications.warn("Cannot pan camera while the game is paused.");
440+
return;
441+
}
442+
443+
432444
// Check if camera panning is allowed
433445
if (!this.allowCameraPanning) {
434446
console.log("Camera panning has been cancelled.");

0 commit comments

Comments
 (0)