This commit is contained in:
CDeenen
2021-09-07 22:49:16 +02:00
parent 66b8406615
commit 874d9c8fb6
15 changed files with 48 additions and 5 deletions

View File

@@ -1,4 +1,21 @@
# Changelog Material Deck Module # Changelog Material Deck Module
### v1.4.6 - 07-09-2021
Fixes:
<ul>
<li>Token Action => Move token: If the user is not the GM, tokens can no longer move if game is paused, and they can no longer move through walls</li>
<li>Modifications made in the Property Inspector now immediately get saved, instead of when user deselects the setting (changed 'onchange' to 'oninput' event)</li>
</ul>
Additions:
<ul>
<li>Playlist Action: Added a 'Pause All' option</li>
</ul>
Other:
<ul>
<li>PF2E compatibility updated (thanks @kyamsil)</li>
</ul>
### v1.4.5 - 27-07-2021 ### v1.4.5 - 27-07-2021
Fixes: Fixes:
<ul> <ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,2 +1,3 @@
play.png: Edited from https://fontawesome.com/icons/play?style=solid play.png: Edited from https://fontawesome.com/icons/play?style=solid
stop.png: Edited from https://fontawesome.com/icons/stop?style=solid stop.png: Edited from https://fontawesome.com/icons/stop?style=solid
pause.png: Edited from https://fontawesome.com/v5.15/icons/pause?style=solid

BIN
img/playlist/pause.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -2,7 +2,7 @@
"name": "MaterialDeck", "name": "MaterialDeck",
"title": "Material Deck", "title": "Material Deck",
"description": "Material Deck allows you to control Foundry using an Elgato Stream Deck", "description": "Material Deck allows you to control Foundry using an Elgato Stream Deck",
"version": "1.4.5", "version": "1.4.6",
"author": "CDeenen", "author": "CDeenen",
"authors": { "authors": {
"name": "CDeenen", "name": "CDeenen",
@@ -22,7 +22,7 @@
], ],
"socket": true, "socket": true,
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.8.8", "compatibleCoreVersion": "0.8.9",
"languages": [ "languages": [
{ {
"lang": "en", "lang": "en",

View File

@@ -36,7 +36,7 @@ export class PlaylistControl{
this.updateTrack(settings,context,device); this.updateTrack(settings,context,device);
} }
else { else {
const src = 'modules/MaterialDeck/img/playlist/stop.png'; const src = mode == 'stopAll' ? 'modules/MaterialDeck/img/playlist/stop.png' : 'modules/MaterialDeck/img/playlist/pause.png';
const background = settings.background ? settings.background : '#000000'; const background = settings.background ? settings.background : '#000000';
const ringColor = (game.playlists.playing.length > 0) ? '#00FF00' : '#000000'; const ringColor = (game.playlists.playing.length > 0) ? '#00FF00' : '#000000';
const ring = (game.playlists.playing.length > 0) ? 2 : 1; const ring = (game.playlists.playing.length > 0) ? 2 : 1;
@@ -167,6 +167,27 @@ export class PlaylistControl{
} }
} }
pauseAll(){
if (game.user.isGM == false) {
const payload = {
"msgType": "pauseAllPlaylists"
};
game.socket.emit(`module.MaterialDeck`, payload);
return;
}
/*
let playing = game.playlists.playing;
for (let i=0; i<playing.length; i++){
for (let sound of playing[i].sounds.contents) {
if (sound.playing) sound.sound.pause();
}
}
*/
for (let elmnt of document.getElementsByClassName('sound-control pause'))
elmnt.click();
}
getPlaylist(num){ getPlaylist(num){
let selectedPlaylists = game.settings.get(MODULE.moduleName,'playlists').selectedPlaylist; let selectedPlaylists = game.settings.get(MODULE.moduleName,'playlists').selectedPlaylist;
if (selectedPlaylists != undefined) if (selectedPlaylists != undefined)
@@ -191,6 +212,9 @@ export class PlaylistControl{
if (playlistMode == 'stopAll') { if (playlistMode == 'stopAll') {
this.stopAll(true); this.stopAll(true);
} }
else if (playlistMode == 'pauseAll') {
this.pauseAll();
}
else { else {
if (playlistType == 'playStop') { if (playlistType == 'playStop') {
let playlist = this.getPlaylist(playlistNr); let playlist = this.getPlaylist(playlistNr);

View File

@@ -80,7 +80,8 @@ export class TokenHelper{
let location = token.getCenter(x,y); let location = token.getCenter(x,y);
canvas.animatePan(location); canvas.animatePan(location);
} }
if (game.user.isGM == false && game.paused == true && (token.can(game.user,"control") == false || token.checkCollision(token.getCenter(x, y)))) return; if (game.user.isGM == false && game.paused) return;
if (game.user.isGM == false && (token.can(game.user,"control") == false || token.checkCollision(token.getCenter(x, y)))) return;
if (compatibleCore("0.8.1")) token.document.update({x:x,y:y}); if (compatibleCore("0.8.1")) token.document.update({x:x,y:y});
else token.update({x:x,y:y}); else token.update({x:x,y:y});
}; };