Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebdc1b5e5c | ||
|
|
07a3bdd837 | ||
|
|
08fdde939a | ||
|
|
484b7a0b7f | ||
|
|
bf8c5c0076 | ||
|
|
e229abc3ee | ||
|
|
51119f42ea | ||
|
|
42e4f8f0d8 | ||
|
|
c3ee0a76aa | ||
|
|
2264d018c2 | ||
|
|
8fa32838d8 | ||
|
|
1552ae6fe8 | ||
|
|
cc9bcf4770 | ||
|
|
7d4fd1e8b1 | ||
|
|
780e06d581 | ||
|
|
64983ca0cb | ||
|
|
dd534488da | ||
|
|
7e2796316e | ||
|
|
7fa5352459 | ||
|
|
c31cea4c64 | ||
|
|
f994e64fc7 | ||
|
|
f0c1b0e1e0 | ||
|
|
cc5dc9ab63 | ||
|
|
64fd6cb132 | ||
|
|
888b089e7b | ||
|
|
959b9c9e4e | ||
|
|
afaf1c9799 | ||
|
|
2947c54eb8 | ||
|
|
561e3f4bd0 | ||
|
|
33f27047b1 | ||
|
|
7c532f5155 | ||
|
|
e62e82795b | ||
|
|
91e07e79c5 |
418
MaterialDeck.js
@@ -1,26 +1,37 @@
|
||||
import {registerSettings} from "./src/settings.js";
|
||||
import {StreamDeck} from "./src/streamDeck.js";
|
||||
import {TokenControl} from "./src/token.js";
|
||||
import {Move} from "./src/move.js";
|
||||
import {MacroControl} from "./src/macro.js";
|
||||
import {CombatTracker} from "./src/combattracker.js";
|
||||
import {PlaylistControl} from "./src/playlist.js";
|
||||
import {SoundboardControl} from "./src/soundboard.js";
|
||||
import {OtherControls} from "./src/othercontrols.js";
|
||||
import {ExternalModules} from "./src/external.js";
|
||||
import {SceneControl} from "./src/scene.js";
|
||||
import {downloadUtility, compatibleCore} from "./src/misc.js";
|
||||
import {TokenHelper} from "./src/systems/tokenHelper.js";
|
||||
export var streamDeck;
|
||||
export var tokenControl;
|
||||
var move;
|
||||
export var macroControl;
|
||||
export var combatTracker;
|
||||
export var playlistControl;
|
||||
export var soundboard;
|
||||
export var otherControls;
|
||||
export var externalModules;
|
||||
export var sceneControl;
|
||||
export var tokenHelper;
|
||||
|
||||
export const moduleName = "MaterialDeck";
|
||||
export var selectedTokenId;
|
||||
|
||||
let ready = false;
|
||||
let activeSounds = [];
|
||||
|
||||
export let hotbarUses = false;
|
||||
export let calculateHotbarUses;
|
||||
|
||||
let controlTokenTimer;
|
||||
|
||||
export let sdVersion;
|
||||
export let msVersion;
|
||||
|
||||
//CONFIG.debug.hooks = true;
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -36,6 +47,8 @@ let wsOpen = false; //Bool for checking if websocket has ever been o
|
||||
let wsInterval; //Interval timer to detect disconnections
|
||||
let WSconnected = false;
|
||||
|
||||
//let furnace = game.modules.get("furnace");
|
||||
|
||||
/*
|
||||
* Analyzes the message received
|
||||
*
|
||||
@@ -47,7 +60,51 @@ async function analyzeWSmessage(msg){
|
||||
//console.log("Received",data);
|
||||
|
||||
if (data.type == "connected" && data.data == "SD"){
|
||||
const msg = {
|
||||
target: "SD",
|
||||
type: "init",
|
||||
system: game.system.id
|
||||
}
|
||||
ws.send(JSON.stringify(msg));
|
||||
|
||||
|
||||
console.log("streamdeck connected to server");
|
||||
streamDeck.resetImageBuffer();
|
||||
}
|
||||
|
||||
if (data.type == "version" && data.source == "SD") {
|
||||
let minimumSDversion;
|
||||
let minimumMSversion;
|
||||
if (compatibleCore("0.8.5")) {
|
||||
minimumSDversion = game.modules.get("MaterialDeck").data.flags.minimumSDversion.replace('v','');
|
||||
minimumMSversion = game.modules.get("MaterialDeck").data.flags.minimumMSversion;
|
||||
}
|
||||
else {
|
||||
minimumSDversion = game.modules.get("MaterialDeck").data.minimumSDversion.replace('v','');
|
||||
minimumMSversion = game.modules.get("MaterialDeck").data.minimumMSversion;
|
||||
}
|
||||
|
||||
sdVersion = data.version;
|
||||
|
||||
if (data.version < minimumSDversion) {
|
||||
let d = new Dialog({
|
||||
title: "Material Deck: Update Needed",
|
||||
content: "<p>The Stream Deck plugin version you're using is v" + data.version + ", which is incompatible with this verion of the module.<br>Update to v" + minimumSDversion + " or newer.</p>",
|
||||
buttons: {
|
||||
download: {
|
||||
icon: '<i class="fas fa-download"></i>',
|
||||
label: "Download Utility",
|
||||
callback: () => new downloadUtility()
|
||||
},
|
||||
ignore: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Ignore"
|
||||
}
|
||||
},
|
||||
default: "download"
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (data == undefined || data.payload == undefined) return;
|
||||
@@ -56,53 +113,60 @@ async function analyzeWSmessage(msg){
|
||||
const event = data.event;
|
||||
const context = data.context;
|
||||
const coordinates = data.payload.coordinates;
|
||||
if (coordinates == undefined) coordinates = 0;
|
||||
const settings = data.payload.settings;
|
||||
const device = data.device;
|
||||
|
||||
|
||||
if (data.data == 'init'){
|
||||
|
||||
}
|
||||
if (event == 'willAppear' || event == 'didReceiveSettings'){
|
||||
if (coordinates == undefined) return;
|
||||
streamDeck.setScreen(action);
|
||||
streamDeck.setContext(action,context,coordinates,settings);
|
||||
await streamDeck.setContext(device,data.size,data.deviceIteration,action,context,coordinates,settings);
|
||||
|
||||
if (action == 'token'){
|
||||
tokenControl.active = true;
|
||||
tokenControl.update(selectedTokenId);
|
||||
tokenControl.pushData(canvas.tokens.controlled[0]?.id,settings,context,device);
|
||||
}
|
||||
else if (action == 'move')
|
||||
move.update(settings,context);
|
||||
else if (action == 'macro')
|
||||
macroControl.update(settings,context);
|
||||
macroControl.update(settings,context,device);
|
||||
else if (action == 'combattracker')
|
||||
combatTracker.update(settings,context);
|
||||
combatTracker.update(settings,context,device);
|
||||
else if (action == 'playlist')
|
||||
playlistControl.update(settings,context);
|
||||
playlistControl.update(settings,context,device);
|
||||
else if (action == 'soundboard')
|
||||
soundboard.update(settings,context);
|
||||
soundboard.update(settings,context,device);
|
||||
else if (action == 'other')
|
||||
otherControls.update(settings,context);
|
||||
otherControls.update(settings,context,device);
|
||||
else if (action == 'external')
|
||||
externalModules.update(settings,context,device);
|
||||
else if (action == 'scene')
|
||||
sceneControl.update(settings,context,device);
|
||||
}
|
||||
|
||||
else if (event == 'willDisappear'){
|
||||
streamDeck.clearContext(action,coordinates);
|
||||
if (coordinates == undefined) return;
|
||||
streamDeck.clearContext(device,action,coordinates,context);
|
||||
}
|
||||
|
||||
else if (event == 'keyDown'){
|
||||
if (action == 'token')
|
||||
tokenControl.keyPress(settings);
|
||||
else if (action == 'move')
|
||||
move.keyPress(settings);
|
||||
else if (action == 'macro')
|
||||
macroControl.keyPress(settings);
|
||||
else if (action == 'combattracker')
|
||||
combatTracker.keyPress(settings,context);
|
||||
combatTracker.keyPress(settings,context,device);
|
||||
else if (action == 'playlist')
|
||||
playlistControl.keyPress(settings,context);
|
||||
playlistControl.keyPress(settings,context,device);
|
||||
else if (action == 'soundboard')
|
||||
soundboard.keyPressDown(settings);
|
||||
else if (action == 'other')
|
||||
otherControls.keyPress(settings);
|
||||
otherControls.keyPress(settings,context,device);
|
||||
else if (action == 'external')
|
||||
externalModules.keyPress(settings,context,device);
|
||||
else if (action == 'scene')
|
||||
sceneControl.keyPress(settings);
|
||||
}
|
||||
|
||||
else if (event == 'keyUp'){
|
||||
@@ -120,7 +184,10 @@ async function analyzeWSmessage(msg){
|
||||
*/
|
||||
function startWebsocket() {
|
||||
const address = game.settings.get(moduleName,'address');
|
||||
ws = new WebSocket('ws://'+address+'/');
|
||||
|
||||
const url = address.startsWith('wss://') ? address : ('ws://'+address+'/');
|
||||
|
||||
ws = new WebSocket(url);
|
||||
|
||||
ws.onmessage = function(msg){
|
||||
//console.log(msg);
|
||||
@@ -130,6 +197,7 @@ function startWebsocket() {
|
||||
}
|
||||
|
||||
ws.onopen = function() {
|
||||
messageCount = 0;
|
||||
WSconnected = true;
|
||||
ui.notifications.info("Material Deck "+game.i18n.localize("MaterialDeck.Notifications.Connected") +": "+address);
|
||||
wsOpen = true;
|
||||
@@ -140,7 +208,8 @@ function startWebsocket() {
|
||||
ws.send(JSON.stringify(msg));
|
||||
const msg2 = {
|
||||
target: "SD",
|
||||
type: "init"
|
||||
type: "init",
|
||||
system: game.system.id
|
||||
}
|
||||
ws.send(JSON.stringify(msg2));
|
||||
clearInterval(wsInterval);
|
||||
@@ -150,13 +219,23 @@ function startWebsocket() {
|
||||
clearInterval(wsInterval);
|
||||
wsInterval = setInterval(resetWS, 10000);
|
||||
}
|
||||
|
||||
let messageCount = 0;
|
||||
/**
|
||||
* Try to reset the websocket if a connection is lost
|
||||
*/
|
||||
function resetWS(){
|
||||
if (wsOpen) ui.notifications.warn("Material Deck: "+game.i18n.localize("MaterialDeck.Notifications.Disconnected"));
|
||||
else ui.notifications.warn("Material Deck: "+game.i18n.localize("MaterialDeck.Notifications.ConnectFail"));
|
||||
const maxMessages = game.settings.get(moduleName, 'nrOfConnMessages');
|
||||
if (maxMessages == 0 || maxMessages > messageCount) {
|
||||
messageCount++;
|
||||
const countString = maxMessages == 0 ? "" : " (" + messageCount + "/" + maxMessages + ")";
|
||||
if (wsOpen) {
|
||||
ui.notifications.warn("Material Deck: "+game.i18n.localize("MaterialDeck.Notifications.Disconnected"));
|
||||
wsOpen = false;
|
||||
messageCount = 0;
|
||||
}
|
||||
else ui.notifications.warn("Material Deck: "+game.i18n.localize("MaterialDeck.Notifications.ConnectFail") + countString);
|
||||
}
|
||||
|
||||
WSconnected = false;
|
||||
startWebsocket();
|
||||
}
|
||||
@@ -166,6 +245,22 @@ export function sendWS(txt){
|
||||
ws.send(txt);
|
||||
}
|
||||
|
||||
export function isEmpty(obj) {
|
||||
for(var key in obj) {
|
||||
if(obj.hasOwnProperty(key))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export function getPermission(action,func) {
|
||||
const role = game.user.role-1;
|
||||
const settings = game.settings.get(moduleName,'userPermission');
|
||||
if (action == 'ENABLE') return settings.enable[role];
|
||||
else return settings.permissions?.[action]?.[func]?.[role];
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Hooks
|
||||
@@ -176,52 +271,87 @@ export function sendWS(txt){
|
||||
* Ready hook
|
||||
* Attempt to open the websocket
|
||||
*/
|
||||
Hooks.once('ready', ()=>{
|
||||
Hooks.once('ready', async()=>{
|
||||
registerSettings();
|
||||
enableModule = (game.settings.get(moduleName,'Enable')) ? true : false;
|
||||
|
||||
game.socket.on(`module.MaterialDeck`, (payload) =>{
|
||||
//console.log(payload);
|
||||
if (payload.msgType != "playSound") return;
|
||||
playTrack(payload.trackNr,payload.src,payload.play,payload.repeat,payload.volume);
|
||||
});
|
||||
|
||||
for (let i=0; i<64; i++)
|
||||
activeSounds[i] = false;
|
||||
|
||||
if (enableModule == false) return;
|
||||
if (game.user.isGM == false) {
|
||||
ready = true;
|
||||
return;
|
||||
}
|
||||
|
||||
startWebsocket();
|
||||
|
||||
soundboard = new SoundboardControl();
|
||||
streamDeck = new StreamDeck();
|
||||
tokenControl = new TokenControl();
|
||||
move = new Move();
|
||||
macroControl = new MacroControl();
|
||||
combatTracker = new CombatTracker();
|
||||
playlistControl = new PlaylistControl();
|
||||
otherControls = new OtherControls();
|
||||
externalModules = new ExternalModules();
|
||||
sceneControl = new SceneControl();
|
||||
tokenHelper = new TokenHelper();
|
||||
|
||||
game.socket.on(`module.MaterialDeck`, async(payload) =>{
|
||||
//console.log(payload);
|
||||
if (payload.msgType == "playSound") soundboard.playSound(payload.trackNr,payload.src,payload.play,payload.repeat,payload.volume);
|
||||
else if (game.user.isGM && payload.msgType == "playPlaylist") {
|
||||
const playlist = playlistControl.getPlaylist(payload.playlistNr);
|
||||
playlistControl.playPlaylist(playlist,payload.playlistNr);
|
||||
}
|
||||
else if (game.user.isGM && payload.msgType == "playTrack") {
|
||||
const playlist = playlistControl.getPlaylist(payload.playlistNr);
|
||||
const sounds = playlist.data.sounds;
|
||||
for (let track of sounds)
|
||||
if (track._id == payload.trackId)
|
||||
playlistControl.playTrack(track,playlist,payload.playlistNr)
|
||||
}
|
||||
else if (game.user.isGM && payload.msgType == "stopAllPlaylists")
|
||||
playlistControl.stopAll(payload.force);
|
||||
else if (game.user.isGM && payload.msgType == "soundboardUpdate") {
|
||||
await game.settings.set(moduleName,'soundboardSettings',payload.settings);
|
||||
const payloadNew = {
|
||||
"msgType": "soundboardRefresh"
|
||||
};
|
||||
game.socket.emit(`module.MaterialDeck`, payloadNew);
|
||||
}
|
||||
else if (game.user.isGM == false && payload.msgType == "soundboardRefresh" && enableModule)
|
||||
soundboard.updateAll();
|
||||
else if (game.user.isGM && payload.msgType == "macroboardUpdate") {
|
||||
await game.settings.set(moduleName,'macroSettings',payload.settings);
|
||||
const payloadNew = {
|
||||
"msgType": "macroboardRefresh"
|
||||
};
|
||||
game.socket.emit(`module.MaterialDeck`, payloadNew);
|
||||
}
|
||||
else if (game.user.isGM == false && payload.msgType == "macroboardRefresh" && enableModule)
|
||||
macroControl.updateAll();
|
||||
else if (game.user.isGM && payload.msgType == "playlistUpdate") {
|
||||
await game.settings.set(moduleName,'playlists',payload.settings);
|
||||
const payloadNew = {
|
||||
"msgType": "playlistRefresh"
|
||||
};
|
||||
game.socket.emit(`module.MaterialDeck`, payloadNew);
|
||||
}
|
||||
else if (game.user.isGM == false && payload.msgType == "playlistRefresh" && enableModule)
|
||||
playlistControl.updateAll();
|
||||
|
||||
});
|
||||
|
||||
let soundBoardSettings = game.settings.get(moduleName,'soundboardSettings');
|
||||
let macroSettings = game.settings.get(moduleName, 'macroSettings');
|
||||
let array = [];
|
||||
for (let i=0; i<64; i++) array[i] = "";
|
||||
let arrayVolume = [];
|
||||
for (let i=0; i<64; i++) arrayVolume[i] = "50";
|
||||
let arrayZero = [];
|
||||
for (let i=0; i<64; i++) arrayZero[i] = "0";
|
||||
|
||||
if (macroSettings.color == undefined){
|
||||
game.settings.set(moduleName,'macroSettings',{
|
||||
macros: array,
|
||||
color: arrayZero
|
||||
});
|
||||
}
|
||||
if (soundBoardSettings.colorOff == undefined){
|
||||
game.settings.set(moduleName,'soundboardSettings',{
|
||||
if (game.user.isGM) {
|
||||
let soundBoardSettings = game.settings.get(moduleName,'soundboardSettings');
|
||||
let macroSettings = game.settings.get(moduleName, 'macroSettings');
|
||||
let array = [];
|
||||
for (let i=0; i<64; i++) array[i] = "";
|
||||
let arrayVolume = [];
|
||||
for (let i=0; i<64; i++) arrayVolume[i] = "50";
|
||||
let arrayZero = [];
|
||||
for (let i=0; i<64; i++) arrayZero[i] = "0";
|
||||
|
||||
if (macroSettings.color == undefined){
|
||||
game.settings.set(moduleName,'macroSettings',{
|
||||
macros: array,
|
||||
color: arrayZero
|
||||
});
|
||||
}
|
||||
|
||||
const settings = {
|
||||
playlist: "",
|
||||
sounds: array,
|
||||
colorOn: arrayZero,
|
||||
@@ -229,37 +359,35 @@ Hooks.once('ready', ()=>{
|
||||
mode: arrayZero,
|
||||
toggle: arrayZero,
|
||||
volume: arrayVolume
|
||||
});
|
||||
};
|
||||
if (soundBoardSettings.colorOff == undefined){
|
||||
game.settings.set(moduleName,'soundboardSettings',settings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (enableModule == false) return;
|
||||
if (getPermission('ENABLE') == false) {
|
||||
ready = true;
|
||||
return;
|
||||
}
|
||||
|
||||
startWebsocket();
|
||||
|
||||
const hotbarUsesTemp = game.modules.get("illandril-hotbar-uses");
|
||||
if (hotbarUsesTemp != undefined) hotbarUses = true;
|
||||
});
|
||||
|
||||
export function playTrack(soundNr,src,play,repeat,volume){
|
||||
if (play){
|
||||
volume *= game.settings.get("core", "globalInterfaceVolume");
|
||||
|
||||
let howl = new Howl({src, volume, loop: repeat, onend: (id)=>{
|
||||
if (repeat == false){
|
||||
activeSounds[soundNr] = false;
|
||||
}
|
||||
},
|
||||
onstop: (id)=>{
|
||||
activeSounds[soundNr] = false;
|
||||
}});
|
||||
howl.play();
|
||||
activeSounds[soundNr] = howl;
|
||||
}
|
||||
else {
|
||||
activeSounds[soundNr].stop();
|
||||
activeSounds[soundNr] = false;
|
||||
}
|
||||
}
|
||||
|
||||
Hooks.on('updateToken',(scene,token)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
let tokenId = token._id;
|
||||
if (tokenId == selectedTokenId)
|
||||
tokenControl.update(selectedTokenId);
|
||||
if (tokenId == canvas.tokens.controlled[0]?.id) tokenControl.update(canvas.tokens.controlled[0]?.id);
|
||||
if (macroControl != undefined) macroControl.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('updateActor',(scene,actor)=>{
|
||||
@@ -268,37 +396,61 @@ Hooks.on('updateActor',(scene,actor)=>{
|
||||
for (let i=0; i<children.length; i++){
|
||||
if (children[i].actor.id == actor._id){
|
||||
let tokenId = children[i].id;
|
||||
if (tokenId == selectedTokenId)
|
||||
tokenControl.update(selectedTokenId);
|
||||
if (tokenId == canvas.tokens.controlled[0]?.id) {
|
||||
tokenControl.update(canvas.tokens.controlled[0]?.id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (macroControl != undefined) macroControl.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('controlToken',(token,controlled)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
if (controlled) {
|
||||
selectedTokenId = token.data._id;
|
||||
tokenControl.update(token.data._id);
|
||||
if (controlTokenTimer != undefined) {
|
||||
clearTimeout(controlTokenTimer);
|
||||
controlTokenTimer = undefined;
|
||||
}
|
||||
}
|
||||
else {
|
||||
selectedTokenId = undefined;
|
||||
controlTokenTimer = setTimeout(function(){tokenControl.update(canvas.tokens.controlled[0]?.id);},10)
|
||||
}
|
||||
tokenControl.update(selectedTokenId);
|
||||
|
||||
if (macroControl != undefined) macroControl.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('updateOwnedItem',()=>{
|
||||
if (macroControl != undefined) macroControl.updateAll();
|
||||
})
|
||||
|
||||
Hooks.on('renderHotbar', (hotbar)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
macroControl.hotbar(hotbar.macros);
|
||||
if (macroControl != undefined) macroControl.hotbar(hotbar.macros);
|
||||
});
|
||||
|
||||
Hooks.on('render', (app)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
if (compatibleCore("0.8.1") == false) return;
|
||||
if (app.id == "hotbar" && macroControl != undefined) macroControl.hotbar(app.macros);
|
||||
|
||||
});
|
||||
|
||||
Hooks.on('renderCombatTracker',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
combatTracker.updateAll();
|
||||
tokenControl.update(selectedTokenId);
|
||||
if (combatTracker != undefined) combatTracker.updateAll();
|
||||
if (tokenControl != undefined) tokenControl.update(canvas.tokens.controlled[0]?.id);
|
||||
});
|
||||
|
||||
Hooks.on('renderActorSheet',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
if (tokenControl != undefined) tokenControl.update();
|
||||
});
|
||||
|
||||
Hooks.on('renderPlaylistDirectory', (playlistDirectory)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
playlistControl.updateAll();
|
||||
if (playlistControl != undefined) playlistControl.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('closeplaylistConfigForm', (form)=>{
|
||||
@@ -312,24 +464,45 @@ Hooks.on('pauseGame',()=>{
|
||||
otherControls.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('renderSidebarTab',()=>{
|
||||
Hooks.on('renderSidebarTab',(app)=>{
|
||||
const options = {
|
||||
sidebarTab: app.tabName,
|
||||
renderPopout: app.popOut
|
||||
}
|
||||
if (enableModule == false || ready == false) return;
|
||||
otherControls.updateAll();
|
||||
if (otherControls != undefined) otherControls.updateAll(options);
|
||||
if (sceneControl != undefined) sceneControl.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('closeSidebarTab',(app)=>{
|
||||
const options = {
|
||||
sidebarTab: app.tabName,
|
||||
renderPopout: false
|
||||
}
|
||||
if (otherControls != undefined) otherControls.updateAll(options);
|
||||
});
|
||||
|
||||
Hooks.on('changeSidebarTab',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
if (otherControls != undefined) otherControls.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('updateScene',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
sceneControl.updateAll();
|
||||
externalModules.updateAll();
|
||||
otherControls.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('renderSceneControls',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
if (enableModule == false || ready == false || otherControls == undefined) return;
|
||||
otherControls.updateAll();
|
||||
externalModules.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('targetToken',(user,token,targeted)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
if (token.id == selectedTokenId) tokenControl.update(selectedTokenId);
|
||||
if (token.id == canvas.tokens.controlled[0]?.id) tokenControl.update(canvas.tokens.controlled[0]?.id);
|
||||
});
|
||||
|
||||
Hooks.on('sidebarCollapse',()=>{
|
||||
@@ -347,19 +520,60 @@ Hooks.on('closeCompendium',()=>{
|
||||
otherControls.updateAll();
|
||||
});
|
||||
|
||||
Hooks.on('renderJournalSheet',()=>{
|
||||
Hooks.on('renderCompendiumBrowser',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
otherControls.updateAll();
|
||||
otherControls.updateAll({renderCompendiumBrowser:true});
|
||||
});
|
||||
|
||||
Hooks.on('closeJournalSheet',()=>{
|
||||
Hooks.on('closeCompendiumBrowser',()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
otherControls.updateAll();
|
||||
otherControls.updateAll({renderCompendiumBrowser:false});
|
||||
});
|
||||
|
||||
Hooks.on('renderJournalSheet',(sheet)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
otherControls.updateAll({
|
||||
hook:'renderJournalSheet',
|
||||
sheet:sheet
|
||||
});
|
||||
});
|
||||
|
||||
Hooks.on('closeJournalSheet',(sheet)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
otherControls.updateAll({
|
||||
hook:'closeJournalSheet',
|
||||
sheet:sheet
|
||||
});
|
||||
});
|
||||
|
||||
Hooks.on('gmScreenOpenClose',(html,isOpen)=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
externalModules.updateAll({gmScreen:isOpen});
|
||||
});
|
||||
|
||||
Hooks.on('ShareVision', ()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
externalModules.updateAll();
|
||||
})
|
||||
|
||||
Hooks.on('NotYourTurn', ()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
externalModules.updateAll();
|
||||
})
|
||||
|
||||
Hooks.on('pseudoclockSet', ()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
externalModules.updateAll();
|
||||
})
|
||||
|
||||
Hooks.on('about-time.clockRunningStatus', ()=>{
|
||||
if (enableModule == false || ready == false) return;
|
||||
externalModules.updateAll();
|
||||
})
|
||||
|
||||
Hooks.once('init', ()=>{
|
||||
//CONFIG.debug.hooks = true;
|
||||
registerSettings(); //in ./src/settings.js
|
||||
//registerSettings(); //in ./src/settings.js
|
||||
});
|
||||
|
||||
Hooks.once('canvasReady',()=>{
|
||||
|
||||
@@ -31,11 +31,6 @@ The functions are categorized into actions. Here is a list of the available acti
|
||||
<li>Toggle token visibility, combat state, conditions</li>
|
||||
</ul>
|
||||
<li>Move Action: Move selected token or the canvas</li>
|
||||
<ul>
|
||||
<li>Move token (in a specified direction)</li>
|
||||
<li>Move canvas (in a specified direction)</li>
|
||||
<li>Zoom canvas in/out</li>
|
||||
</ul>
|
||||
<li>Macro Actions: Execute macros</li>
|
||||
<ul>
|
||||
<li>Execute macro from hotbar</li>
|
||||
@@ -71,7 +66,7 @@ Instructions and more info can be found in the <a href="https://github.com/CDeen
|
||||
Module manifest: https://raw.githubusercontent.com/CDeenen/MaterialDeck/Master/module.json
|
||||
|
||||
## Software Versions & Module Incompatibilities
|
||||
<b>Foundry VTT:</b> Tested on 0.7.7<br>
|
||||
<b>Foundry VTT:</b> Tested on 0.7.9 - 0.8.5<br>
|
||||
<b>Module Incompatibilities:</b> None known.<br>
|
||||
|
||||
## Feedback
|
||||
@@ -81,6 +76,8 @@ If you have any suggestions or bugs to report, feel free to create an issue, con
|
||||
<b>Author:</b> Cristian Deenen (Cris#6864 on Discord)<br>
|
||||
<br>
|
||||
Special thanks to Asmodeus#7588 who made this module possible by generously donating a Stream Deck XL
|
||||
<br>
|
||||
Please consider supporting me on <a href="https://www.patreon.com/materialfoundry">Patreon</a>, and feel free to join the Material Foundry <a href="https://discord.gg/3hd4G6TkmA">Discord</a> server.
|
||||
|
||||
## Abandonment
|
||||
Abandoned modules are a (potential) problem for Foundry, because users and/or other modules might rely on abandoned modules, which might break in future Foundry updates.<br>
|
||||
|
||||
315
changelog.md
@@ -1,19 +1,322 @@
|
||||
# Changelog Material Deck Module
|
||||
### v1.4.4 - 26-05-2021
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Some small fixes to make the module compatible with Foundry 0.8.5</li>
|
||||
</ul>
|
||||
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Token Action => Added 'Page-Wide Token' option. All buttons on the current page (where the page is the collection of buttons that are shown) that have this enabled will use the same token</li>
|
||||
<li>Token Action => On Click: Added 'Set Page-Wide Token' option, so you can configure buttons to set the page-wide token by pressing a button</li>
|
||||
<li>Token Action: Added a 'Mode' select box. Setting it to 'Token' is the same as pre v1.4.4. New are the inventory, features and spellbook options that can be used to auto-populate buttons with items, features and spells.</li>
|
||||
<li>Added a 'Clear Page' and 'Clear All' button to the soundboard and macroboard configuration</li>
|
||||
<li>Added import and export buttons to the soundboard and macroboard configuration (only imports/exports metadata, not the actual audio files or the macros)</li>
|
||||
<li>The number of connection error messages you will get is now configurable in the module settings</li>
|
||||
<li>Added a download utility to the module settings, so you can easily version-check with the SD plugin and Material Server, download them and download profiles</li>
|
||||
<li>Added Japanese localization (thanks BrotherSharper and Asami). All of the new features have not yet been translated</li>
|
||||
</ul>
|
||||
|
||||
Other:
|
||||
<ul>
|
||||
<li><b>(Breaking)</b> The Move Action has been removed. Moving tokens is not in the Token Action (it's an on click setting) and moving the canvas is in the Other Actions.</li>
|
||||
<li>Major change to the soundboard and macroboard configuration. It is now displayed as pages of 16 sounds or 32 macros each, you can browse through the pages using the arrow keys at the top.</li>
|
||||
<li>There is no longer a limit to the amount of sounds/macros you can assign to the soundboard/macroboard, but please note that at some point you might experience performance issues if there's too many sounds/macros.</li>
|
||||
<li>Removed the 'Stream Deck Model' module setting, since it's not that useful</li>
|
||||
<li>Token Action has been revamped to make it clearer and easier to implement new game systems</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.4.4 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.4.3 - 05-05-2021
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Fixed issue where the module would break if multiple Stream Decks were configured in the Stream Deck application, but not all of them had MD actions assigned to them</li>
|
||||
<li>In the User Permission Configuration, the Scene Directory hint wasn't displayed properly</li>
|
||||
<li>Got rid of warnings that popped up on initialization when using MD as a player</li>
|
||||
<li>Fixed issue where the soundboard and macro board could not be configured by players, if it hadn't first been configured by a GM</li>
|
||||
</ul>
|
||||
|
||||
Other
|
||||
<ul>
|
||||
<li>Added compatibility for Foundry 0.8.2. Some functions no longer work in 0.8.1 (they still do in 0.7.9)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.4.2 (unchanged): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.4.2 - 23-04-2021
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Last update I fixed the combat tracker, but this broke something in the Token Action (if you had a token selected, it would sometimes assumed you didn't have it selected), both should now work</li>
|
||||
<li>Token Action: Plugin wouldn't save text boxes (such as 'Prepend Title' or 'Custom') if they were empty</li>
|
||||
<li>Token Action: Improved performance, especially when 'Token' is set to 'Selected Token', and you're selecting a new token while you had another token selected<li>
|
||||
<li>Token Action => Stats => Skill Modifier: (dnd5e) Would only display the modifier, now it displays the total value (so with proficiency, if applicable)</li>
|
||||
<li>Combat Tracker => Mode: Function => Function: Would not always properly load the 'Turn Display' options</li>
|
||||
<li>Playlist Action: Background color would not show, and 'Off Color' wouldn't work for 'Offset'</li>
|
||||
<li>Macro Action => Macro Board => Offset: Background color would not show</li>
|
||||
<li>Scene Action => Offset: Background color would not show</li>
|
||||
</ul>
|
||||
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Token Action: Changed the way how you can select what icon will be displayed. Instead of a true/false, there is now a selection box where you can select between 'None', 'Token Icon', 'Actor Icon' and 'Default', where the last one will display the default icon, for example the selected stat to display, the condition, etc</li>
|
||||
<li>Token Action => Stats & On Click => Custom: Textbox now automatically resizes to fit the content</li>
|
||||
<li>Token Action => On Click => Dice Roll: Added 'Roll Mode' option, where you can set to roll as 'default' (displays dialog), 'normal', 'advantage' or 'disadvantage'. All options, except for 'default', will ignore the previously added 'Token Roll Options' in 'Other Actions'</li>
|
||||
</ul>
|
||||
|
||||
Other:
|
||||
<ul>
|
||||
<li>Big code cleanup of the SD plugin</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.4.2 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.4.1 - 21-04-2021
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Previous update broke the combat tracker, should now be fixed</li>
|
||||
</ul>
|
||||
|
||||
### v1.4.0 - 21-04-2021
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Support for connecting multiple Stream Decks at the same time. Please note that performance decreases with each extra Stream Deck</li>
|
||||
<li>Other Actions: Added 'Token Roll Options'. This can toggle token rolls between showing a dialog and skipping the dialog and rolling normally or with advantage or disadvantage</li>
|
||||
<li>If the SD plugin version you're using is outdated, you now get a pop-up to notify you of this and direct you to the download page</li>
|
||||
<li>Added a module setting to set how dark the default white images should be. Can be lowered for improved readability of the text</li>
|
||||
<li>Token Action => Stats: Added option to prepend text to the title, so you can set the stat to, for example, strength, and put 'STR: ' in the prepend textbox to display, for example, 'STR: +2'</li>
|
||||
</ul>
|
||||
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Token Action => Skill Roll: Setting wasn't saved in SD app</li>
|
||||
<li>Token Action => Roll Ability: Rolling ability checks was broken for some systems</li>
|
||||
<li>Token Action => Stats => Display HP: Read overlay indicating HP in the heart icon was also drawn when 'Display Token Icon' was enabled</li>
|
||||
<li>Token Action => Stats: Added default images for all dnd5e abilities, saves and skills</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.4.0 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
|
||||
### v1.3.3 - 12-04-2021
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Other Actions => Open Sidebar Tab: Action now indicates which sidebar tab is open (only works on Foundry 0.8.x)</li>
|
||||
<li>Other Actions => Open Sidebar Tab: Added option to create an pop-out (doesn't work for the chat)</li>
|
||||
<li>Other Actions: Added option to open the pf2e compendium browser</li>
|
||||
<li>Macro Action: Can now call macros by name</li>
|
||||
<li>Token Action => On Click: Added option to call a macro. Currently the macro will be applied to the selected token</li>
|
||||
<li>Token Action => Display Stats: Added saving throws and skill modifiers for most systems</li>
|
||||
<li>Token Action => OnClick: Added 'Dice Roll' option, which allows you to roll ability checks, saving throws and other things (depending on game system)</li>
|
||||
<li>Token Action => Stats => Display HP: Made the heart icon dynamic, so the amount that the heart is filled with red depends on the relative amount of hit points of the token. 25% hp means the lower 25% of the heart is red, 50% hp means the lower 50% of the heart is red, etc</li>
|
||||
<li>Token Action => Stats => Added a '+' before all modifier stats that are bigger than 0</li>
|
||||
<li>Token Action => Custom OnClick: Added support for calling macros. For instructions, please refer to the documentation: https://github.com/CDeenen/MaterialDeck/wiki/Token-Action#custom-on-click-function</li>
|
||||
</ul>
|
||||
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Other Actions => Pause Game: Pause is now transmitted to all connected clients</li>
|
||||
<li>Token Action => Display Stats: Fixed movement speed for pf2e</li>
|
||||
</ul>
|
||||
|
||||
Other:
|
||||
<ul>
|
||||
<li>Should be compatible with Foundry 0.8.1. Only tested on DnD5e. Please note that any functions that rely on other modules do not work if the other modules are not compatible with 0.8.1</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.3.4 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.3.2 - 11-03-2021
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Added support for the Multi Action provided by the SD app</li>
|
||||
<li>External Modules Action => Added support for About Time</li>
|
||||
<li>Token Action => Stats: Added 'Ability Scores', 'Ability Score Modifiers', 'Ability Score Saves' (dnd5e only) and 'Proficiency Bonus'</li>
|
||||
<li>Token Action => Stats: Added 'HP (box)' option that displays a box with color that changes depending on the HP</li>
|
||||
<li>Move Action: You can now choose what token should be moved, similar to the Token Action</li>
|
||||
</ul>
|
||||
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Playlist Action => Relative Offset: Fixed issue with displaying the target playlist name</li>
|
||||
<li>Macro Action: Fixed Hotbar Uses for Shadow of the Demonlord</li>
|
||||
</ul>
|
||||
|
||||
Other:
|
||||
<ul>
|
||||
<li>Macro Action: Improved the way Hotbar Uses are displayed, it is now displayed in a box similar to how the module looks in Foundry</li>
|
||||
<li>Made the way images are generated more flexible to make future additions easier</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.3.2 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.3.1 - 27-02-2021
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Token Action: You can now choose what token should be targeted with the action using: 'Selected Token', 'Token Name', 'Actor Name', 'Token Id' or 'Actor Id'. Added relevant user permissions to the permission configuration</li>
|
||||
<li>Token Action => On Click: Added options 'Select Token' and 'Center on Token and Select Token'</li>
|
||||
<li>Playlist Action: Added relative offset mode, with the option to display the offset target name for playlists</li>
|
||||
<li>Playlist Action => Stop All: Added option to display the name of the playlist at the current offset</li>
|
||||
</ul>
|
||||
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Default user permissions would not be loaded if no previously saved permissions were present, resulting in MD assuming nobody has any permissions</li>
|
||||
<li>Other Actions => Control Buttons => Lighting Controls: Would create a button for ambient sound instead of lighting</li>
|
||||
<li>Token Action => Display Token Icon: It used to show the icon, even if unchecked, if no stat with default icon was selected</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.3.1 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.3.0 - 25-02-2021
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Material Deck can now be used by players. A 'User Permission Configuration' screen has been added to the module settings where the GM can deside what Material Deck functions are available to users</li>
|
||||
<li>Macro Action: Added support for Illandril's Hotbar Uses (only requires the module to be installed, does not have to be active)</li>
|
||||
<li>Token Action => OnClick: Added support for CUB conditions</li>
|
||||
<li>External Modules => Added support for the 'Trigger Happy' module</li>
|
||||
<li>External Modules => Added support for the 'MookAI' module</li>
|
||||
<li>External Modules => Added support for the 'Shared Vision' module</li>
|
||||
<li>External Modules => Added support for the 'Lock View' module</li>
|
||||
<li>External Modules => Added support for the 'Not Your Turn' module</li>
|
||||
</ul>
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Token Action => OnClick: Fixed conditions for pf1e and dnd3.5e</li>
|
||||
</ul>
|
||||
Other Changes:
|
||||
<ul>
|
||||
<li>Token and Combat Tracker Actions now autodetect the game system</li>
|
||||
<li>Game-system related settings in the SD app unified and improved</li>
|
||||
<li>Image Cache setting is no longer considered experimental</li>
|
||||
</ul>
|
||||
|
||||
<b>Note 1: </b>Because the module can now be used by players, some settings have been moved from 'world' settings to 'client' settings. This means that previous settings have been deleted, and they have to be set up again in the module settings.<br>
|
||||
<b>Note 2: </b>You can give users access to the playlists, macro board and soundboard. Currently, everyone has to share the same configuration, so be careful with giving players permission to configure one of them.<br>
|
||||
<b>Note 3: </b>Because of the new game system autodetection, some settings for non dnd5e systems might be deleted. You'll have to reconfigure them.<br>
|
||||
<br>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.3.0 (<b>must be updated!</b>): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.2.3 - 03-02-2021
|
||||
Fixes:
|
||||
<ul>
|
||||
<li>Fixed some issues for the Shadow of the Demon Lord system</li>
|
||||
</ul>
|
||||
Other Changes:
|
||||
<ul>
|
||||
<li>Improved performance of the 'Playlist Configuration', 'Macro Configuration' and 'Soundboard Configuration' screens</li>
|
||||
<li>Minor code clean-up</li>
|
||||
</ul>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.2.2 (unchanged): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.2.2 - 02-02-2021
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Added a help button in the module configuration</li>
|
||||
<li>Token Action: Added support for easy token wildcard image changes</li>
|
||||
<li>Token Action: Added a comprehensive custom onClick function that can modify token and actor data, with support for basic mathematical expressions</li>
|
||||
</ul>
|
||||
Other Changes:
|
||||
<ul>
|
||||
<li>Improved GM screen compatibility</li>
|
||||
</ul>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.2.2: https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.2.1 - 07-01-2021
|
||||
<b>Note:</b> Due to a change in how scene control is handled (moved from 'Other Controls' to its own 'Scene Action'), any actions related to scenes no longer work. You will have to set them up again using the new Scene Action.<br>
|
||||
<br>
|
||||
Additions:
|
||||
<ul>
|
||||
<li>EXPERIMENTAL: Added an image buffer to prevent resending of images that have already been sent, giving a slight performance boost. Buffer size can be set in the module settings</li>
|
||||
<li>Token Action => Display Stats: Added option to select a data path for an attribute</li>
|
||||
<li>External Modules => GM Screen: Open and close the GM screen. Link to module: https://foundryvtt.com/packages/gm-screen/</li>
|
||||
<li>Other Actions => Roll dice: Roll dice in foundry and select between public roll, private roll, or displaying result on the SD</li>
|
||||
<li>Scene Action: Added way to create scene selection screen similar to soundboard/macro board. New functions to do this: 'Scene Directory' and 'Scene Offset'</li>
|
||||
<li>Scene Action: Added 'Active Scene' function</li>
|
||||
<li>Move Action => Selected Token: Added rotate to and rotate by functions</li>
|
||||
<li>Token Action => On Click: Added 'Set Vision' option to set the token's vision and light emission</li>
|
||||
<li>Other Actions => Send Chat Message: Send a message to the Foundry chat</li>
|
||||
</ul>
|
||||
Other Changes:
|
||||
<ul>
|
||||
<li>Plugin: Scene Action created that replaces Other Actions => Scene Selection</li>
|
||||
<li>Plugin: Scene Action: Changed 'Any Scene' to 'Scene by Name'</li>
|
||||
<li>Plugin: Actions are now ordered alphabetically</li>
|
||||
<li>Plugin: Replaced color strings with color pickers</li>
|
||||
<li>Various minor bug fixes</li>
|
||||
</ul>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.2.1: https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.2.0 - 28-12-2020
|
||||
Fixes
|
||||
<ul>
|
||||
<li>Incorrect link to some black backgrounds fixed</li>
|
||||
<li>Token Action: Movement speed wouldn't be displayed for DnD5e 1.2.0</li>
|
||||
<li>Macro Action => Hotbar: 10th macro would not trigger and display correctly</li>
|
||||
<li>Combat Tracker Action => Function: Default value would not properly initialize</li>
|
||||
<li>Other Actions => Darkness Control => Display would not function correctly</li>
|
||||
<li>Fixed some issues in the SD plugin where correct settings would not be displayed</li>
|
||||
</ul>
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Added new 'External Modules Action', which will contain all module integrations that don't fit anywhere else</li>
|
||||
<li>Added support for the Custom Hotbar module in 'Macro Action' => Mode: 'Custom Hotbar'. Link to module: https://foundryvtt.com/packages/custom-hotbar/</li>
|
||||
<li>Added support for the FxMaster module in 'External Modules Action' => Mode: 'Fx Master'. Link to module: https://foundryvtt.com/packages/fxmaster/</li>
|
||||
</ul>
|
||||
|
||||
### v1.1.1 - 12-12-2020
|
||||
Fixes
|
||||
<ul>
|
||||
<li>Fixed issue where deleting a playlist would cause an error preventing the Soundboard Configuration to show up</li>
|
||||
</ul>
|
||||
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
SD plugin v1.1.0 (unchanged): https://github.com/CDeenen/MaterialDeck_SD/releases<br>
|
||||
|
||||
### v1.1.0 - 09-12-2020
|
||||
Fixes
|
||||
<ul>
|
||||
<li>Settings would not show for Combat Tracker action</li>
|
||||
<li>Macro Action => Macro Board default settings fixed</li>
|
||||
</li>
|
||||
Additions/changes:
|
||||
<li>API has been improved, making integration with other hardware/software easier, and making future changes/additions easier</li>
|
||||
</ul>
|
||||
Additions:
|
||||
<ul>
|
||||
<li>Added support for Pathfinder 1e and Shadow of the Demon Lord</li>
|
||||
<li>All dialogs that are openable using the SD can now be closed by pressing the button while the dialog is open</li>
|
||||
<li>Playlist Action & Soundboard Action => Stop All now indicates if there are tracks/playlists/sounds playing</li>
|
||||
<li>Confirmed Foundry 0.7.8 compatibility</li>
|
||||
<li>API has been improved, making integration with other hardware/software easier, and making future changes/additions easier</li>
|
||||
<li>Moved default images to Foundry module side instead of Stream Deck plugin</li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Material Server v1.0.2 (unchanged): https://github.com/CDeenen/MaterialServer/releases <br>
|
||||
@@ -130,4 +433,4 @@ SD plugin v0.7.0<br>
|
||||
</ul>
|
||||
<b>Compatible server app and SD plugin:</b><br>
|
||||
Server v0.2.4<br>
|
||||
SD plugin v0.7.1<br>
|
||||
SD plugin v0.7.1<br>
|
||||
|
||||
BIN
img/.thumb/MaterialFoundry512x512.png.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
img/MaterialFoundry512x512.png
Normal file
|
After Width: | Height: | Size: 359 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
img/external/.thumb/external.png.jpg
vendored
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
img/external/.thumb/external@2x.png.jpg
vendored
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
img/external/.thumb/fxmaster.png.jpg
vendored
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
2
img/external/SOURCES.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
external.png: Edited from https://fontawesome.com/icons/external-link-alt?style=solid
|
||||
fxmaster.png: Edited from https://fontawesome.com/icons/magic?style=solid
|
||||
BIN
img/external/external.png
vendored
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
img/external/external@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
img/external/fxmaster.png
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
img/move/.thumb/rotateccw.png.jpg
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
img/move/.thumb/rotatecw.png.jpg
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
@@ -1,2 +1,3 @@
|
||||
center.png: made by me
|
||||
center.png: made by me.
|
||||
rotatecw.png & rotateccw.png Edited from https://fontawesome.com/icons/sync-alt?style=solid.
|
||||
All other images taken from freepngimg.com, iverted color and rotated. Source: https://freepngimg.com/png/24691-right-arrow-hd
|
||||
BIN
img/move/rotateccw.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
img/move/rotatecw.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
img/other/.thumb/cogs.png.jpg
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
img/other/.thumb/d20.png.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
@@ -1 +1,3 @@
|
||||
other.png: Made using https://www.elgato.com/en/gaming/keycreator
|
||||
other.png: Made using https://www.elgato.com/en/gaming/keycreator
|
||||
cogs.png: Edited from https://fontawesome.com/icons/cogs?style=solid
|
||||
d20.png: Edited from https://game-icons.net/1x1/delapouite/dice-twenty-faces-twenty.html
|
||||
BIN
img/other/cogs.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
img/other/d20.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 23 KiB |
BIN
img/token/.thumb/hp_empty.png.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
img/token/.thumb/temp_hp_empty.png.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
@@ -1,5 +1,5 @@
|
||||
ac.webp: Foundry's icon folder, original name: heater-steel-worn.webp
|
||||
hp.png: made using Elgato's key creator: https://www.elgato.com/en/gaming/keycreator
|
||||
hp.png, hp_empty.png and temp_hp_empty.png: made using/modified from Elgato's key creator: https://www.elgato.com/en/gaming/keycreator
|
||||
init.png: freepngimg.com, color inverted, from: https://freepngimg.com/png/81025-art-dice-dungeons-system-dragons-d20-triangle/icon
|
||||
speed.webp: Foundry's icon folder, original name: shoes-collared-leather-blue.webp
|
||||
mystery-man.png: Foundry's icon folder, converted from .svg
|
||||
BIN
img/token/abilities/.thumb/cha.png.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/abilities/.thumb/cons.png.jpg
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
img/token/abilities/.thumb/dex.png.jpg
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
img/token/abilities/.thumb/int.png.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/abilities/.thumb/str.png.jpg
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
img/token/abilities/.thumb/wis.png.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
7
img/token/abilities/SOURCES.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
All images licenced under CC BY 3.0. Grabbed from game-icons.net
|
||||
str.png: https://game-icons.net/1x1/delapouite/weight-lifting-up.html
|
||||
dex.png: https://game-icons.net/1x1/darkzaitzev/acrobatic.html
|
||||
cons.png: https://game-icons.net/1x1/zeromancer/heart-plus.html
|
||||
int.png: https://game-icons.net/1x1/lorc/bookmarklet.html
|
||||
wis.png: https://game-icons.net/1x1/delapouite/wisdom.html
|
||||
cha.png: https://game-icons.net/1x1/lorc/icicles-aura.html
|
||||
BIN
img/token/abilities/cha.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
img/token/abilities/cons.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
img/token/abilities/dex.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/abilities/int.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/abilities/str.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/abilities/wis.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
img/token/hp_empty.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/skills/.thumb/acr.png.jpg
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
img/token/skills/.thumb/ani.png.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/skills/.thumb/arc.png.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/skills/.thumb/ath.png.jpg
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
img/token/skills/.thumb/dec.png.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
img/token/skills/.thumb/his.png.jpg
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
img/token/skills/.thumb/ins.png.jpg
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
img/token/skills/.thumb/inv.png.jpg
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
img/token/skills/.thumb/itm.png.jpg
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
img/token/skills/.thumb/med.png.jpg
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
img/token/skills/.thumb/nat.png.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
img/token/skills/.thumb/per.png.jpg
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
img/token/skills/.thumb/prc.png.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
img/token/skills/.thumb/prf.png.jpg
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
img/token/skills/.thumb/rel.png.jpg
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
img/token/skills/.thumb/slt.png.jpg
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
img/token/skills/.thumb/ste.png.jpg
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
img/token/skills/.thumb/sur.png.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
19
img/token/skills/SOURCES.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
All images licenced under CC BY 3.0. Grabbed from game-icons.net
|
||||
acr.png: https://game-icons.net/1x1/delapouite/contortionist.html
|
||||
ani.png: https://game-icons.net/1x1/delapouite/cavalry.html
|
||||
arc.png: https://game-icons.net/1x1/delapouite/spell-book.html
|
||||
ath.png: https://game-icons.net/1x1/lorc/muscle-up.html
|
||||
dec.png: https://game-icons.net/1x1/delapouite/convince.html
|
||||
his.png: https://game-icons.net/1x1/delapouite/backward-time.html
|
||||
ins.png: https://game-icons.net/1x1/lorc/light-bulb.html
|
||||
itm.png: https://game-icons.net/1x1/lorc/one-eyed.html
|
||||
inv.png: https://game-icons.net/1x1/lorc/magnifying-glass.html
|
||||
med.png: https://game-icons.net/1x1/delapouite/first-aid-kit.html
|
||||
nat.png: https://game-icons.net/1x1/delapouite/forest.html
|
||||
prc.png: https://game-icons.net/1x1/lorc/semi-closed-eye.html
|
||||
prf.png: https://game-icons.net/1x1/lorc/sing.html
|
||||
per.png: https://game-icons.net/1x1/delapouite/public-speaker.html
|
||||
rel.png: https://game-icons.net/1x1/lorc/holy-grail.html
|
||||
slt.png: https://game-icons.net/1x1/lorc/snatch.html
|
||||
ste.png: https://game-icons.net/1x1/lorc/cloak-dagger.html
|
||||
sur.png: https://game-icons.net/1x1/delapouite/pyre.html
|
||||
BIN
img/token/skills/acr.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
img/token/skills/ani.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
img/token/skills/arc.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/skills/ath.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/skills/dec.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
img/token/skills/his.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
img/token/skills/ins.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
img/token/skills/inv.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/skills/itm.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
img/token/skills/med.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
img/token/skills/nat.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
img/token/skills/per.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
img/token/skills/prc.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
img/token/skills/prf.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/skills/rel.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/token/skills/slt.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/skills/ste.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/token/skills/sur.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
img/token/temp_hp_empty.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
180
lang/en.json
@@ -2,18 +2,24 @@
|
||||
"MaterialDeck.Notifications.Disconnected": "Disconnected from Material Server, attempting to reconnect",
|
||||
"MaterialDeck.Notifications.ConnectFail": "Can't connect to Material Server, retrying",
|
||||
"MaterialDeck.Notifications.Connected": "Connected",
|
||||
"MaterialDeck.Notifications.Soundboard.NoPermission": "You do not have permission to configure the soundboard",
|
||||
"MaterialDeck.Notifications.Macroboard.NoPermission": "You do not have permission to configure the macroboard",
|
||||
"MaterialDeck.Notifications.Playlist.NoPermission": "You do not have permission to configure the playlists",
|
||||
|
||||
"MaterialDeck.Sett.Enable": "Enable module",
|
||||
"MaterialDeck.Sett.Model": "Stream Deck Model",
|
||||
"MaterialDeck.Sett.Model_Hint": "Reduces the amount of macros and sounds in the macro and soundboard configuration screens. Gives a better overview, but if desired it can be set to XL to get the maximum number. This doesn't influence the operation of the module.",
|
||||
"MaterialDeck.Sett.Model_Mini": "Mini",
|
||||
"MaterialDeck.Sett.Model_Normal": "Normal or Mobile",
|
||||
"MaterialDeck.Sett.Model_XL": "XL",
|
||||
"MaterialDeck.Sett.Help": "Help",
|
||||
"MaterialDeck.Sett.Permission": "User Permission Configuration",
|
||||
"MaterialDeck.Sett.PlaylistConfig": "Playlist Configuration",
|
||||
"MaterialDeck.Sett.MacroConfig": "Macro Configuration",
|
||||
"MaterialDeck.Sett.SoundboardConfig": "Soundboard Configuration",
|
||||
"MaterialDeck.Sett.ServerAddr": "Material Server Address",
|
||||
"MaterialDeck.Sett.ServerAddrHint": "Fill in the IP address and port of the Material Server. Must follow the format [ip_address]:[port], for example: 'localhost:3001' or '192.168.1.1:4000'.",
|
||||
"MaterialDeck.Sett.ServerAddrHint": "The IP address and port of Material Server. The default value will work for 99% of people, only change this if you know what you're doing. Must follow the format [ip_address]:[port], for example: 'localhost:3001' or '192.168.1.1:4000'.",
|
||||
"MaterialDeck.Sett.ImageBuffer": "Image Cache Size",
|
||||
"MaterialDeck.Sett.ImageBufferHint": "Sets the amount of images to store in the image cache. The image cache will locally store all images sent to the Stream Deck. This improves the update speed, but increases memory usage.",
|
||||
"MaterialDeck.Sett.ImageBrightness": "Image Brightness",
|
||||
"MaterialDeck.Sett.ImageBrightnessHint": "Sets the brightness of the default white images. If the Image Cache Size is bigger than 0, perform a refresh for instant results.",
|
||||
"MaterialDeck.Sett.NrOfConnMessages": "Number of Connection Warnings",
|
||||
"MaterialDeck.Sett.NrOfConnMessagesHint": "Sets the number of times a connection warning is displayed if Material Deck cannot connect to Material Server. If set to 0, it will give not be limited.",
|
||||
|
||||
"MaterialDeck.PL.Unrestricted": "Unrestricted",
|
||||
"MaterialDeck.PL.OneTrackPlaylist": "One track per playlist",
|
||||
@@ -30,6 +36,8 @@
|
||||
"MaterialDeck.Background": "Background",
|
||||
"MaterialDeck.Macro": "Macro",
|
||||
"MaterialDeck.Sound": "Sound",
|
||||
"MaterialDeck.Sounds": "Sounds",
|
||||
"MaterialDeck.Of": "of",
|
||||
"MaterialDeck.Icon": "Icon",
|
||||
"MaterialDeck.Once": "Once",
|
||||
"MaterialDeck.Repeat": "Repeat",
|
||||
@@ -40,6 +48,162 @@
|
||||
"MaterialDeck.Off": "Off",
|
||||
"MaterialDeck.Name": "Name",
|
||||
"MaterialDeck.None": "None",
|
||||
"MaterialDeck.Save": "Save"
|
||||
}
|
||||
"MaterialDeck.Save": "Save",
|
||||
"MaterialDeck.ClearAll": "Clear All",
|
||||
"MaterialDeck.ClearAll_Content": "This will clear all the data. This cannot be undone, are you sure you want to proceed?",
|
||||
"MaterialDeck.ClearPage": "Clear Page",
|
||||
"MaterialDeck.ClearPage_Content": "This will clear all the data on this page. This cannot be undone, are you sure you want to proceed?",
|
||||
"MaterialDeck.Continue": "Continue",
|
||||
"MaterialDeck.Cancel": "Cancel",
|
||||
"MaterialDeck.Import": "Import",
|
||||
"MaterialDeck.Export": "Export",
|
||||
"MaterialDeck.Filename": "Filename",
|
||||
|
||||
"MaterialDeck.ExportDialog.Title": "Export",
|
||||
"MaterialDeck.ExportDialog.SoundboardContent": "Export the soundboard data. Please note that only the metadata is exported, so you will have to make sure the audio files are in the same relative location when you import them.",
|
||||
"MaterialDeck.ExportDialog.MacroboardContent": "Export the macroboard data. Please note that only the metadata is exported, so you will have to make sure the same macros are available when you import them.",
|
||||
|
||||
"MaterialDeck.ImportDialog.Title": "Import",
|
||||
"MaterialDeck.ImportDialog.SoundboardContent": "Select a file to import. Please note that only the metadata is imported, so you will have to make sure the audio files are in the same relative location as when you exported them.",
|
||||
"MaterialDeck.ImportDialog.MacroboardContent": "Import the macroboard data. ",
|
||||
"MaterialDeck.ImportDialog.Warning": "This will overwrite your current settings, and cannot be undone.",
|
||||
|
||||
"MaterialDeck.FxMaster.Colorize": "Colorize",
|
||||
"MaterialDeck.FxMaster.Clear": "Clear All",
|
||||
|
||||
"MaterialDeck.Perm.Instructions": "Configure the permission for each Material Deck action.",
|
||||
"MaterialDeck.Perm.DefaultNotification": "Material Deck user permissions have been configured to the default values.",
|
||||
|
||||
"MaterialDeck.Perm.ENABLE.label": "Enable Module",
|
||||
"MaterialDeck.Perm.ENABLE.ENABLE.label": "Enable",
|
||||
"MaterialDeck.Perm.ENABLE.ENABLE.hint": "Allow users to use Material Deck",
|
||||
|
||||
"MaterialDeck.Perm.COMBAT.label": "Combat Tracker",
|
||||
"MaterialDeck.Perm.COMBAT.END_TURN.label": "End Turn",
|
||||
"MaterialDeck.Perm.COMBAT.END_TURN.hint": "Allow users to end their turn",
|
||||
"MaterialDeck.Perm.COMBAT.TURN_DISPLAY.label": "Turn Display",
|
||||
"MaterialDeck.Perm.COMBAT.TURN_DISPLAY.hint": "Allow users to display the turn display",
|
||||
"MaterialDeck.Perm.COMBAT.OTHER_FUNCTIONS.label": "Other Functions",
|
||||
"MaterialDeck.Perm.COMBAT.OTHER_FUNCTIONS.hint": "Allow users to use other functions in the 'Function Mode', such as starting/stopping combat, increasing/decreasing the turn, etc",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_COMBATANTS.label": "Display Combatants",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_COMBATANTS.hint": "Allow users to display the combatants",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_NON_OWNED_STATS.label": "Display Non-Owned and Non-Observer Stats",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_NON_OWNED_STATS.hint": "Allow users to display stats for tokens they do not own or have observer permission for",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_HP.label": "Display Limited HP",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_HP.hint": "Allow users to display the HP of tokens they have Limited permission for",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_HP.label": "Display Observer HP",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_HP.hint": "Allow users to display the HP of tokens they have Observer permission for",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_ALL_NAMES.label": "Display All Names",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_ALL_NAMES.hint": "Allow users to display the name of all tokens",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_NAME.label": "Display Limited Name",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_NAME.hint": "Allow users to display the name of tokens they have Limited permission for",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_NAME.label": "Display Observer Name",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_NAME.hint": "Allow users to display the name of tokens they have Observer permission for",
|
||||
|
||||
"MaterialDeck.Perm.EXTERNAL.label": "External Modules",
|
||||
"MaterialDeck.Perm.EXTERNAL.FXMASTER.label": "Fx Master",
|
||||
"MaterialDeck.Perm.EXTERNAL.FXMASTER.hint": "Allow users to control the Fx Master module",
|
||||
"MaterialDeck.Perm.EXTERNAL.GM_SCREEN.label": "GM Screen",
|
||||
"MaterialDeck.Perm.EXTERNAL.GM_SCREEN.hint": "Allow users to display a GM screen using the GM Screen module",
|
||||
|
||||
"MaterialDeck.Perm.MACRO.label": "Macros",
|
||||
"MaterialDeck.Perm.MACRO.HOTBAR.label": "Hotbar Macros",
|
||||
"MaterialDeck.Perm.MACRO.HOTBAR.hint": "Allow users to use hotbar macros",
|
||||
"MaterialDeck.Perm.MACRO.BY_NAME.label": "Macro by Name",
|
||||
"MaterialDeck.Perm.MACRO.BY_NAME.hint": "Allow users to call macros by name",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD.label": "Macro Board",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD.hint": "Allow users to use the macroboard",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD_CONFIGURE.label": "Configure the Macro Board",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD_CONFIGURE.hint": "Allow users to configure the macroboard. To allow users to pick icons using the filepicker, enable 'Browse File Explorer' for that user in the core Permission Configuration",
|
||||
|
||||
"MaterialDeck.Perm.OTHER.label": "Other",
|
||||
"MaterialDeck.Perm.OTHER.PAUSE.label": "Pause/Resume",
|
||||
"MaterialDeck.Perm.OTHER.PAUSE.hint": "Allow users to pause or resume the game",
|
||||
"MaterialDeck.Perm.OTHER.CONTROL.label": "Control Buttons",
|
||||
"MaterialDeck.Perm.OTHER.CONTROL.hint": "Allow users to control the control buttons",
|
||||
"MaterialDeck.Perm.OTHER.DARKNESS.label": "Scene Darkness",
|
||||
"MaterialDeck.Perm.OTHER.DARKNESS.hint": "Allow users to set the scene darkness",
|
||||
"MaterialDeck.Perm.OTHER.DICE.label": "Dice Rolling",
|
||||
"MaterialDeck.Perm.OTHER.DICE.hint": "Allow users to roll dice",
|
||||
"MaterialDeck.Perm.OTHER.TABLES_ALL.label": "Roll Tables (all)",
|
||||
"MaterialDeck.Perm.OTHER.TABLES_ALL.hint": "Allow users to view and roll from all roll tables",
|
||||
"MaterialDeck.Perm.OTHER.TABLES.label": "Roll Tables (observer/owner)",
|
||||
"MaterialDeck.Perm.OTHER.TABLES.hint": "Allow users to view and roll from roll tables that they have observer or owner permission for",
|
||||
"MaterialDeck.Perm.OTHER.SIDEBAR.label": "Sidebar",
|
||||
"MaterialDeck.Perm.OTHER.SIDEBAR.hint": "Allow users to control the sidebar",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM_ALL.label": "Compendium Packs (all)",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM_ALL.hint": "Allow users to open all compendium packs",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM.label": "Compendium Packs (observer/owner)",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM.hint": "Allow users to open compendium packs that they have observer or owner permission for",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL_ALL.label": "Journals (all)",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL_ALL.hint": "Allow users to open all journals",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL.label": "Journals (observer/owner)",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL.hint": "Allow users to open journals they have observer or owner permission for",
|
||||
"MaterialDeck.Perm.OTHER.CHAT.label": "Chat Messages",
|
||||
"MaterialDeck.Perm.OTHER.CHAT.hint": "Allow users to send chat messages",
|
||||
|
||||
"MaterialDeck.Perm.PLAYLIST.label": "Playlists",
|
||||
"MaterialDeck.Perm.PLAYLIST.PLAY.label": "Control",
|
||||
"MaterialDeck.Perm.PLAYLIST.PLAY.hint": "Allow users to play and pause playlists and tracks",
|
||||
"MaterialDeck.Perm.PLAYLIST.CONFIGURE.label": "Configure",
|
||||
"MaterialDeck.Perm.PLAYLIST.CONFIGURE.hint": "Allow users to configure the playlists",
|
||||
|
||||
"MaterialDeck.Perm.SCENE.label": "Scenes",
|
||||
"MaterialDeck.Perm.SCENE.VISIBLE.label": "Visible Scenes",
|
||||
"MaterialDeck.Perm.SCENE.VISIBLE.hint": "Allow users to view and control the visible scenes",
|
||||
"MaterialDeck.Perm.SCENE.ACTIVE.label": "Active Scene",
|
||||
"MaterialDeck.Perm.SCENE.ACTIVE.hint": "Allow users to view the active scene",
|
||||
"MaterialDeck.Perm.SCENE.DIRECTORY.label": "Scene Directory",
|
||||
"MaterialDeck.Perm.SCENE.DIRECTORY.hint": "Allow users to view and control scenes from the scene directory",
|
||||
"MaterialDeck.Perm.SCENE.NAME.label": "Scene by Name",
|
||||
"MaterialDeck.Perm.SCENE.NAME.hint": "Allow users to view and control any scene by name",
|
||||
|
||||
"MaterialDeck.Perm.SOUNDBOARD.label": "Soundboard",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.PLAY.label": "Enable",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.PLAY.hint": "Allow users to play sounds from the soundboard",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.CONFIGURE.label": "Configure",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.CONFIGURE.hint": "Allow users to configure the soundboard. To allow users to pick files and icons using the filepicker, enable 'Browse File Explorer' for that user in the core Permission Configuration",
|
||||
|
||||
"MaterialDeck.Perm.TOKEN.label": "Token",
|
||||
"MaterialDeck.Perm.TOKEN.STATS.label": "Display Stats",
|
||||
"MaterialDeck.Perm.TOKEN.STATS.hint": "Allow the user to display the stats of the controlled token",
|
||||
"MaterialDeck.Perm.TOKEN.VISIBILITY.label": "Toggle Visibility",
|
||||
"MaterialDeck.Perm.TOKEN.VISIBILITY.hint": "Allow the user to toggle the visibility of the controlled token",
|
||||
"MaterialDeck.Perm.TOKEN.COMBAT.label": "Toggle Combat State",
|
||||
"MaterialDeck.Perm.TOKEN.COMBAT.hint": "Allow the user to toggle the combat state of the controlled token",
|
||||
"MaterialDeck.Perm.TOKEN.VISION.label": "Set Vision",
|
||||
"MaterialDeck.Perm.TOKEN.VISION.hint": "Allow the user to set the vision of the controlled token",
|
||||
"MaterialDeck.Perm.TOKEN.WILDCARD.label": "Wildcard Images",
|
||||
"MaterialDeck.Perm.TOKEN.WILDCARD.hint": "Allow the user to set the controlled token's image using the wildcard image functionality",
|
||||
"MaterialDeck.Perm.TOKEN.CONDITIONS.label": "Set Conditions",
|
||||
"MaterialDeck.Perm.TOKEN.CONDITIONS.hint": "Allow the users to set conditions for the controlled token",
|
||||
"MaterialDeck.Perm.TOKEN.CUSTOM.label": "Custom On-Click",
|
||||
"MaterialDeck.Perm.TOKEN.CUSTOM.hint": "Allow the users to set custom on-click functions",
|
||||
"MaterialDeck.Perm.TOKEN.NON_OWNED.label": "Non-Owned and Non-Observer Tokens",
|
||||
"MaterialDeck.Perm.TOKEN.NON_OWNED.hint": "Allow users access to tokens with non-owned or limited permission",
|
||||
"MaterialDeck.Perm.TOKEN.OBSERVER.label": "Observer",
|
||||
"MaterialDeck.Perm.TOKEN.OBSERVER.hint": "Allow users access to tokens with observer permission",
|
||||
|
||||
"MaterialDeck.AboutTime.First": "st",
|
||||
"MaterialDeck.AboutTime.Second": "nd",
|
||||
"MaterialDeck.AboutTime.Third": "rd",
|
||||
"MaterialDeck.AboutTime.Fourth": "th",
|
||||
"MaterialDeck.AboutTime.Of": "of",
|
||||
|
||||
"MaterialDeck.DownloadUtility.Title": "Download Utility",
|
||||
"MaterialDeck.DownloadUtility.Plugin": "Plugin & Material Server",
|
||||
"MaterialDeck.DownloadUtility.Minimum": "Minimum",
|
||||
"MaterialDeck.DownloadUtility.Current": "Current",
|
||||
"MaterialDeck.DownloadUtility.Latest": "Latest",
|
||||
"MaterialDeck.DownloadUtility.OS": "OS",
|
||||
"MaterialDeck.DownloadUtility.Download": "Download",
|
||||
"MaterialDeck.DownloadUtility.SDplugin": "SD Plugin",
|
||||
"MaterialDeck.DownloadUtility.MSserver": "Material Server",
|
||||
"MaterialDeck.DownloadUtility.Windows": "Windows",
|
||||
"MaterialDeck.DownloadUtility.Macos": "MacOS",
|
||||
"MaterialDeck.DownloadUtility.Linux": "Linux",
|
||||
"MaterialDeck.DownloadUtility.Source": "Source",
|
||||
"MaterialDeck.DownloadUtility.Profiles": "Profiles",
|
||||
"MaterialDeck.DownloadUtility.Name": "Name",
|
||||
"MaterialDeck.DownloadUtility.Refresh": "Refresh"
|
||||
}
|
||||
209
lang/ja.json
Normal file
@@ -0,0 +1,209 @@
|
||||
{
|
||||
"MaterialDeck.Notifications.Disconnected": "Material Serverから切断され、再接続を試みています",
|
||||
"MaterialDeck.Notifications.ConnectFail": "Material Serverに接続できません、再試行します",
|
||||
"MaterialDeck.Notifications.Connected": "に接続しました",
|
||||
"MaterialDeck.Notifications.Soundboard.NoPermission": "サウンドボードを設定する権限がありません",
|
||||
"MaterialDeck.Notifications.Macroboard.NoPermission": "マクロボードを設定する権限がありません",
|
||||
"MaterialDeck.Notifications.Playlist.NoPermission": "プレイリストを設定する権限がありません",
|
||||
|
||||
"MaterialDeck.Sett.Enable": "モジュールの有効化",
|
||||
"MaterialDeck.Sett.Help": "ヘルプ",
|
||||
"MaterialDeck.Sett.Permission": "ユーザー権限の設定",
|
||||
"MaterialDeck.Sett.PlaylistConfig": "プレイリスト設定",
|
||||
"MaterialDeck.Sett.MacroConfig": "マクロ設定",
|
||||
"MaterialDeck.Sett.SoundboardConfig": "サウンド設定",
|
||||
"MaterialDeck.Sett.ServerAddr": "Material Server アドレス",
|
||||
"MaterialDeck.Sett.ServerAddrHint": "MaterialServerのIPアドレスとポート。デフォルト値は99%の人に有効ですが、何をしているのかがわかっている場合にのみ変更してください。[ip_address]:[port]の形式に従う必要があります。例:「localhost:3001」または「192.168.1.1:4000」。",
|
||||
"MaterialDeck.Sett.ImageBuffer": "画像キャッシュサイズ",
|
||||
"MaterialDeck.Sett.ImageBufferHint": "画像キャッシュに保存する画像のデータ量を設定します。画像キャッシュは、ストリームデッキに送信されたすべての画像をローカルに保存します。これにより更新速度は向上しますが、メモリ使用量は増加します。",
|
||||
"MaterialDeck.Sett.ImageBrightness": "画像の明るさ",
|
||||
"MaterialDeck.Sett.ImageBrightnessHint": "デフォルトの画像の明るさを設定します。画像キャッシュサイズが0より大きい場合、更新を実行してください。",
|
||||
"MaterialDeck.Sett.NrOfConnMessages": "Number of Connection Warnings",
|
||||
"MaterialDeck.Sett.NrOfConnMessagesHint": "Sets the number of times a connection warning is displayed if Material Deck cannot connect to Material Server. If set to 0, it will give not be limited.",
|
||||
|
||||
"MaterialDeck.PL.Unrestricted": "無制限",
|
||||
"MaterialDeck.PL.OneTrackPlaylist": "プレイリストごとに1つのトラック",
|
||||
"MaterialDeck.PL.OneTrackTotal": "合計1トラック",
|
||||
"MaterialDeck.PL.OneTrack": "1トラック",
|
||||
"MaterialDeck.PL.Settings": "設定",
|
||||
"MaterialDeck.PL.Mode": "デフォルトの再生モード",
|
||||
"MaterialDeck.PL.Nr": "プレイリストの数",
|
||||
|
||||
"MaterialDeck.Playlists": "プレイリスト",
|
||||
"MaterialDeck.Playlist": "プレイリスト",
|
||||
"MaterialDeck.FilePicker": "ファイルを選ぶ",
|
||||
"MaterialDeck.FurnaceArgs": "炉の引数",
|
||||
"MaterialDeck.Background": "背景",
|
||||
"MaterialDeck.Macro": "マクロ",
|
||||
"MaterialDeck.Sound": "サウンド",
|
||||
"MaterialDeck.Sounds": "Sounds",
|
||||
"MaterialDeck.Of": "of",
|
||||
"MaterialDeck.Icon": "アイコン",
|
||||
"MaterialDeck.Once": "一度だけ再生",
|
||||
"MaterialDeck.Repeat": "リピート再生",
|
||||
"MaterialDeck.Hold": "ホールド",
|
||||
"MaterialDeck.Playback": "再生",
|
||||
"MaterialDeck.Volume": "音量",
|
||||
"MaterialDeck.On": "On",
|
||||
"MaterialDeck.Off": "Off",
|
||||
"MaterialDeck.Name": "名前",
|
||||
"MaterialDeck.None": "無し",
|
||||
"MaterialDeck.Save": "セーブ",
|
||||
"MaterialDeck.ClearAll": "Clear All",
|
||||
"MaterialDeck.ClearAll_Content": "This will clear all the data. This cannot be undone, are you sure you want to proceed?",
|
||||
"MaterialDeck.ClearPage": "Clear Page",
|
||||
"MaterialDeck.ClearPage_Content": "This will clear all the data on this page. This cannot be undone, are you sure you want to proceed?",
|
||||
"MaterialDeck.Continue": "Continue",
|
||||
"MaterialDeck.Cancel": "Cancel",
|
||||
"MaterialDeck.Import": "Import",
|
||||
"MaterialDeck.Export": "Export",
|
||||
"MaterialDeck.Filename": "Filename",
|
||||
|
||||
"MaterialDeck.ExportDialog.Title": "Export",
|
||||
"MaterialDeck.ExportDialog.SoundboardContent": "Export the soundboard data. Please note that only the metadata is exported, so you will have to make sure the audio files are in the same relative location when you import them.",
|
||||
"MaterialDeck.ExportDialog.MacroboardContent": "Export the macro board data. Please note that only the metadata is exported, so you will have to make sure the same macros are available when you import them.",
|
||||
|
||||
"MaterialDeck.ImportDialog.Title": "Import",
|
||||
"MaterialDeck.ImportDialog.SoundboardContent": "Select a file to import. Please note that only the metadata is imported, so you will have to make sure the audio files are in the same relative location as when you exported them.",
|
||||
"MaterialDeck.ImportDialog.MacroboardContent": "Import the macro board data. ",
|
||||
"MaterialDeck.ImportDialog.Warning": "This will overwrite your current settings, and cannot be undone.",
|
||||
|
||||
"MaterialDeck.FxMaster.Colorize": "色付け",
|
||||
"MaterialDeck.FxMaster.Clear": "すべてクリア",
|
||||
|
||||
"MaterialDeck.Perm.Instructions": "各Material Deckアクションの権限を設定します。",
|
||||
"MaterialDeck.Perm.DefaultNotification": "Material Deckのユーザー権限がデフォルト値に設定されています。",
|
||||
|
||||
"MaterialDeck.Perm.ENABLE.label": "モジュールを有効にする",
|
||||
"MaterialDeck.Perm.ENABLE.ENABLE.label": "有効にする",
|
||||
"MaterialDeck.Perm.ENABLE.ENABLE.hint": "ユーザーがMaterial Deckを使用できるようにします",
|
||||
|
||||
"MaterialDeck.Perm.COMBAT.label": "イニシアチブ表",
|
||||
"MaterialDeck.Perm.COMBAT.END_TURN.label": "ターン終了",
|
||||
"MaterialDeck.Perm.COMBAT.END_TURN.hint": "ユーザーが自分のターンを終了できるようにします",
|
||||
"MaterialDeck.Perm.COMBAT.TURN_DISPLAY.label": "ターン表示",
|
||||
"MaterialDeck.Perm.COMBAT.TURN_DISPLAY.hint": "ユーザーがターン表示できるようにします",
|
||||
"MaterialDeck.Perm.COMBAT.OTHER_FUNCTIONS.label": "その他の機能",
|
||||
"MaterialDeck.Perm.COMBAT.OTHER_FUNCTIONS.hint": "戦闘の開始/停止、ターンの増減など、ユーザーが「機能モード」で他の機能を使用できるようにします。",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_COMBATANTS.label": "戦闘参加者の表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_COMBATANTS.hint": "ユーザーが戦闘参加者を表示できるようにします",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_NON_OWNED_STATS.label": "所有されていないステータスと、オブザーバー以外のステータスを表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_NON_OWNED_STATS.hint": "ユーザーが所有していないか、オブザーバー権限を持っていないトークンのステータスを表示できるようにする",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_HP.label": "リミテッド権限のHP表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_HP.hint": "ユーザーがリミテッド権限を持つトークンのHPを表示できるようにする",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_HP.label": "オブザーバー権限のHP表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_HP.hint": "ユーザーがオブザーバー権限を持つトークンのHPを表示できるようにする",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_ALL_NAMES.label": "すべての名前を表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_ALL_NAMES.hint": "ユーザーがすべてのトークンの名前を表示できるようにする",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_NAME.label": "リミテッド権限の名前表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_LIMITED_NAME.hint": "ユーザーがリミテッド権限を持つトークンの名前を表示できるようにする",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_NAME.label": "オブザーバー権限の名前表示",
|
||||
"MaterialDeck.Perm.COMBAT.DISPLAY_OBSERVER_NAME.hint": "ユーザーがオブザーバー権限を持つトークンの名前を表示できるようにする",
|
||||
|
||||
"MaterialDeck.Perm.EXTERNAL.label": "外部モジュール",
|
||||
"MaterialDeck.Perm.EXTERNAL.FXMASTER.label": "Fx Master",
|
||||
"MaterialDeck.Perm.EXTERNAL.FXMASTER.hint": "ユーザーがFxマスターモジュールを制御できるようにする",
|
||||
"MaterialDeck.Perm.EXTERNAL.GM_SCREEN.label": "GM Screen",
|
||||
"MaterialDeck.Perm.EXTERNAL.GM_SCREEN.hint": "ユーザーがGM Screenモジュールを使用してGM画面を表示できるようにする",
|
||||
|
||||
"MaterialDeck.Perm.MACRO.label": "マクロ",
|
||||
"MaterialDeck.Perm.MACRO.HOTBAR.label": "ホットバーマクロ",
|
||||
"MaterialDeck.Perm.MACRO.HOTBAR.hint": "ユーザーがホットバーマクロを使用できるようにする",
|
||||
"MaterialDeck.Perm.MACRO.BY_NAME.label": "名前でマクロ呼出",
|
||||
"MaterialDeck.Perm.MACRO.BY_NAME.hint": "ユーザーが名前でマクロを呼び出すことを許可します",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD.label": "マクロボード",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD.hint": "ユーザーがマクロボードを使用できるようにする",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD_CONFIGURE.label": "マクロボードの設定",
|
||||
"MaterialDeck.Perm.MACRO.MACROBOARD_CONFIGURE.hint": "ユーザーがマクロボードを設定できるようにする。ユーザーがファイルエクスプローラを使用してアイコンを選択できるようにするには、コア設定の「権限の設定」でそのユーザーに対して「ファイルエクスプローラの使用」を有効にすること。",
|
||||
|
||||
"MaterialDeck.Perm.OTHER.label": "その他",
|
||||
"MaterialDeck.Perm.OTHER.PAUSE.label": "一時停止/再開",
|
||||
"MaterialDeck.Perm.OTHER.PAUSE.hint": "ユーザーがゲームを一時停止または再開できるようにする",
|
||||
"MaterialDeck.Perm.OTHER.CONTROL.label": "コントロールボタン",
|
||||
"MaterialDeck.Perm.OTHER.CONTROL.hint": "ユーザーがコントロールボタンを制御できるようにする",
|
||||
"MaterialDeck.Perm.OTHER.DARKNESS.label": "シーンの暗さ",
|
||||
"MaterialDeck.Perm.OTHER.DARKNESS.hint": "ユーザーがシーンの暗さを設定できるようにする",
|
||||
"MaterialDeck.Perm.OTHER.DICE.label": "ダイスロール",
|
||||
"MaterialDeck.Perm.OTHER.DICE.hint": "ユーザーがダイスを振ることを許可する",
|
||||
"MaterialDeck.Perm.OTHER.TABLES_ALL.label": "ロールテーブル(すべて)",
|
||||
"MaterialDeck.Perm.OTHER.TABLES_ALL.hint": "ユーザーがすべてのロールテーブルの表示、およびロールすることを許可する",
|
||||
"MaterialDeck.Perm.OTHER.TABLES.label": "ロールテーブル(オブザーバー/所有者)",
|
||||
"MaterialDeck.Perm.OTHER.TABLES.hint": "ユーザーがオブザーバーまたは所有者の権限を持つロールテーブルを表示およびロールできるようにする",
|
||||
"MaterialDeck.Perm.OTHER.SIDEBAR.label": "サイドバー",
|
||||
"MaterialDeck.Perm.OTHER.SIDEBAR.hint": "ユーザーがサイドバーを制御できるようにする",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM_ALL.label": "辞典(すべて)",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM_ALL.hint": "ユーザーがすべての辞典を開くことを許可する",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM.label": "辞典(オブザーバー/所有者)",
|
||||
"MaterialDeck.Perm.OTHER.COMPENDIUM.hint": "ユーザーがオブザーバーまたは所有者権限を持つ辞典を開くことを許可する",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL_ALL.label": "資料(すべて)",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL_ALL.hint": "ユーザーがすべての資料を開くことを許可する",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL.label": "資料(オブザーバー/所有者)",
|
||||
"MaterialDeck.Perm.OTHER.JOURNAL.hint": "ユーザーがオブザーバーまたは所有者権限を持つ資料を開くことを許可する",
|
||||
"MaterialDeck.Perm.OTHER.CHAT.label": "チャットメッセージ",
|
||||
"MaterialDeck.Perm.OTHER.CHAT.hint": "ユーザーがチャットメッセージを送信できるようにする",
|
||||
|
||||
"MaterialDeck.Perm.PLAYLIST.label": "プレイリスト",
|
||||
"MaterialDeck.Perm.PLAYLIST.PLAY.label": "制御",
|
||||
"MaterialDeck.Perm.PLAYLIST.PLAY.hint": "ユーザーがプレイリストとサウンドを再生および一時停止できるようにする",
|
||||
"MaterialDeck.Perm.PLAYLIST.CONFIGURE.label": "設定",
|
||||
"MaterialDeck.Perm.PLAYLIST.CONFIGURE.hint": "ユーザーがプレイリストを設定できるようにする",
|
||||
|
||||
"MaterialDeck.Perm.SCENE.label": "シーン",
|
||||
"MaterialDeck.Perm.SCENE.VISIBLE.label": "シーンの可視状態",
|
||||
"MaterialDeck.Perm.SCENE.VISIBLE.hint": "ユーザーが表示されているシーンを表示および制御できるようにする",
|
||||
"MaterialDeck.Perm.SCENE.ACTIVE.label": "シーンの有効化",
|
||||
"MaterialDeck.Perm.SCENE.ACTIVE.hint": "ユーザーが有効化されたシーンを表示できるようにする",
|
||||
"MaterialDeck.Perm.SCENE.DIRECTORY.label": "シーンディレクトリ",
|
||||
"MaterialDeck.Perm.SCENE.DIRECTORY.hint": "ユーザーがシーンディレクトリからシーンを表示および制御できるようにする",
|
||||
"MaterialDeck.Perm.SCENE.NAME.label": "名前によるシーン",
|
||||
"MaterialDeck.Perm.SCENE.NAME.hint": "ユーザーが名前で任意のシーンを表示および制御できるようにする",
|
||||
|
||||
"MaterialDeck.Perm.SOUNDBOARD.label": "サウンドボード",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.PLAY.label": "有効にする",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.PLAY.hint": "ユーザーがサウンドボードからサウンドを再生できるようにする",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.CONFIGURE.label": "設定",
|
||||
"MaterialDeck.Perm.SOUNDBOARD.CONFIGURE.hint": "ユーザーがサウンドボードを設定できるようにする。ユーザーがファイルエクスプローラを使用してアイコンを選択できるようにするには、コア設定の「権限の設定」でそのユーザーに対して「ファイルエクスプローラの使用」を有効にすること。",
|
||||
|
||||
"MaterialDeck.Perm.TOKEN.label": "トークン",
|
||||
"MaterialDeck.Perm.TOKEN.STATS.label": "ステータス表示",
|
||||
"MaterialDeck.Perm.TOKEN.STATS.hint": "ユーザーが制御されたトークンのステータスを表示できるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.VISIBILITY.label": "可視状態の切替",
|
||||
"MaterialDeck.Perm.TOKEN.VISIBILITY.hint": "ユーザーが制御するトークンの表示を切り替えることができるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.COMBAT.label": "戦闘状態の切替",
|
||||
"MaterialDeck.Perm.TOKEN.COMBAT.hint": "ユーザーが制御するトークンの戦闘状態を切り替えることができるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.VISION.label": "視覚を有効化",
|
||||
"MaterialDeck.Perm.TOKEN.VISION.hint": "ユーザーが制御されたトークンの視覚を設定できるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.WILDCARD.label": "ワイルドカード画像",
|
||||
"MaterialDeck.Perm.TOKEN.WILDCARD.hint": "ユーザーがワイルドカード画像機能を使用して制御するトークンの画像を設定できるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.CONDITIONS.label": "状態設定",
|
||||
"MaterialDeck.Perm.TOKEN.CONDITIONS.hint": "ユーザーが制御するトークンの状態を設定できるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.CUSTOM.label": "カスタムオンクリック",
|
||||
"MaterialDeck.Perm.TOKEN.CUSTOM.hint": "ユーザーがカスタムオンクリック機能を設定できるようにする",
|
||||
"MaterialDeck.Perm.TOKEN.NON_OWNED.label": "非所有者/非オブザーバートークン",
|
||||
"MaterialDeck.Perm.TOKEN.NON_OWNED.hint": "所有者またはオブザーバーではない権限を持つトークンへのアクセスをユーザーに許可する",
|
||||
"MaterialDeck.Perm.TOKEN.OBSERVER.label": "オブザーバー",
|
||||
"MaterialDeck.Perm.TOKEN.OBSERVER.hint": "オブザーバー権限を持つトークンへのユーザーアクセスを許可する",
|
||||
|
||||
"MaterialDeck.AboutTime.First": "1",
|
||||
"MaterialDeck.AboutTime.Second": "2",
|
||||
"MaterialDeck.AboutTime.Third": "3",
|
||||
"MaterialDeck.AboutTime.Fourth": "4",
|
||||
"MaterialDeck.AboutTime.Of": "/",
|
||||
|
||||
"MaterialDeck.DownloadUtility.Title": "Download Utility",
|
||||
"MaterialDeck.DownloadUtility.Plugin": "Plugin & Material Server",
|
||||
"MaterialDeck.DownloadUtility.Minimum": "Minimum",
|
||||
"MaterialDeck.DownloadUtility.Current": "Current",
|
||||
"MaterialDeck.DownloadUtility.Latest": "Latest",
|
||||
"MaterialDeck.DownloadUtility.OS": "OS",
|
||||
"MaterialDeck.DownloadUtility.Download": "Download",
|
||||
"MaterialDeck.DownloadUtility.SDplugin": "SD Plugin",
|
||||
"MaterialDeck.DownloadUtility.MSserver": "Material Server",
|
||||
"MaterialDeck.DownloadUtility.Windows": "Windows",
|
||||
"MaterialDeck.DownloadUtility.Macos": "MacOS",
|
||||
"MaterialDeck.DownloadUtility.Linux": "Linux",
|
||||
"MaterialDeck.DownloadUtility.Source": "Source",
|
||||
"MaterialDeck.DownloadUtility.Profiles": "Profiles",
|
||||
"MaterialDeck.DownloadUtility.Name": "Name",
|
||||
"MaterialDeck.DownloadUtility.Refresh": "Refresh"
|
||||
}
|
||||
69
module.json
@@ -1,23 +1,48 @@
|
||||
{
|
||||
"name": "MaterialDeck",
|
||||
"title": "Material Deck",
|
||||
"description": "Material Deck allows you to control Foundry using an Elgato Stream Deck",
|
||||
"version": "1.1.0",
|
||||
"author": "CDeenen",
|
||||
"esmodules": [
|
||||
"./MaterialDeck.js"
|
||||
],
|
||||
"socket": true,
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.7.8",
|
||||
"languages": [
|
||||
{
|
||||
"lang": "en",
|
||||
"name": "English",
|
||||
"path": "lang/en.json"
|
||||
}
|
||||
],
|
||||
"url": "https://github.com/CDeenen/MaterialDeck",
|
||||
"manifest": "https://raw.githubusercontent.com/CDeenen/MaterialDeck/Master/module.json",
|
||||
"download": "https://github.com/CDeenen/MaterialDeck/archive/Master.zip"
|
||||
}
|
||||
"name": "MaterialDeck",
|
||||
"title": "Material Deck",
|
||||
"description": "Material Deck allows you to control Foundry using an Elgato Stream Deck",
|
||||
"version": "1.4.4",
|
||||
"author": "CDeenen",
|
||||
"authors": {
|
||||
"name": "CDeenen",
|
||||
"email": "cdeenen@outlook.com",
|
||||
"discord": "Cris#6864",
|
||||
"patreon": "MaterialFoundry",
|
||||
"reddit": "CDeenen123"
|
||||
},
|
||||
"flags": {
|
||||
"minimumSDversion": "1.4.4",
|
||||
"minimumMSversion": "1.0.2"
|
||||
},
|
||||
"minimumSDversion": "1.4.4",
|
||||
"minimumMSversion": "1.0.2",
|
||||
"esmodules": [
|
||||
"./MaterialDeck.js"
|
||||
],
|
||||
"socket": true,
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.8.5",
|
||||
"languages": [
|
||||
{
|
||||
"lang": "en",
|
||||
"name": "English",
|
||||
"path": "lang/en.json"
|
||||
},
|
||||
{
|
||||
"lang": "ja",
|
||||
"name": "日本語",
|
||||
"path": "lang/ja.json"
|
||||
}
|
||||
],
|
||||
"media": [
|
||||
{
|
||||
"type": "icon",
|
||||
"url": "https://raw.githubusercontent.com/CDeenen/MaterialDeck/Master/img/MaterialFoundry512x512.png"
|
||||
}
|
||||
],
|
||||
"manifestPlusVersion": "1.1.0",
|
||||
"url": "https://github.com/CDeenen/MaterialDeck",
|
||||
"manifest": "https://raw.githubusercontent.com/CDeenen/MaterialDeck/Master/module.json",
|
||||
"download": "https://github.com/CDeenen/MaterialDeck/archive/Master.zip"
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as MODULE from "../MaterialDeck.js";
|
||||
import {streamDeck, tokenControl} from "../MaterialDeck.js";
|
||||
import {compatibleCore} from "./misc.js";
|
||||
|
||||
export class CombatTracker{
|
||||
constructor(){
|
||||
@@ -9,62 +10,83 @@ export class CombatTracker{
|
||||
|
||||
async updateAll(){
|
||||
if (this.active == false) return;
|
||||
for (let i=0; i<32; i++){
|
||||
let data = streamDeck.buttonContext[i];
|
||||
if (data == undefined || data.action != 'combattracker') continue;
|
||||
await this.update(data.settings,data.context);
|
||||
for (let device of streamDeck.buttonContext) {
|
||||
if (device?.buttons == undefined) continue;
|
||||
for (let i=0; i<device.buttons.length; i++){
|
||||
const data = device.buttons[i];
|
||||
if (data == undefined || data.action != 'combattracker') continue;
|
||||
await this.update(data.settings,data.context,device.device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(settings,context){
|
||||
update(settings,context,device){
|
||||
this.active = true;
|
||||
let ctFunction = settings.combatTrackerFunction;
|
||||
if (ctFunction == undefined) ctFunction == 'startStop';
|
||||
|
||||
|
||||
let combat = game.combat;
|
||||
const ctFunction = settings.combatTrackerFunction ? settings.combatTrackerFunction : 'startStop';
|
||||
const mode = settings.combatTrackerMode ? settings.combatTrackerMode : 'combatants';
|
||||
const combat = game.combat;
|
||||
let src = "modules/MaterialDeck/img/black.png";
|
||||
let txt = "";
|
||||
let background = "#000000";
|
||||
let mode = settings.combatTrackerMode;
|
||||
if (mode == undefined) mode = 'combatants';
|
||||
|
||||
settings.combat = true;
|
||||
settings.icon = settings.displayIcon ? 'tokenIcon' : 'none';
|
||||
|
||||
if (mode == 'combatants'){
|
||||
if (MODULE.getPermission('COMBAT','DISPLAY_COMBATANTS') == false) {
|
||||
streamDeck.noPermission(context,device,device,false,"combat tracker");
|
||||
return;
|
||||
}
|
||||
if (combat != null && combat != undefined && combat.turns.length != 0){
|
||||
let initiativeOrder = combat.turns;
|
||||
const initiativeOrder = combat.turns;
|
||||
let nr = settings.combatantNr - 1;
|
||||
if (nr == undefined || nr < 1) nr = 0;
|
||||
let combatantState = 1;
|
||||
if (nr == combat.turn) combatantState = 2;
|
||||
let combatant = initiativeOrder[nr]
|
||||
const combatantState = (nr == combat.turn) ? 2 : 1;
|
||||
const combatant = initiativeOrder[nr]
|
||||
|
||||
if (combatant != undefined){
|
||||
let tokenId = combatant.tokenId;
|
||||
tokenControl.pushData(tokenId,settings,context,combatantState,'#cccc00');
|
||||
const tokenId = compatibleCore("0.8.1") ? combatant.data.tokenId : combatant.tokenId;
|
||||
tokenControl.pushData(tokenId,settings,context,device,combatantState,'#cccc00');
|
||||
return;
|
||||
}
|
||||
else {
|
||||
streamDeck.setIcon(context,src,background);
|
||||
streamDeck.setIcon(context,device,src,{background:background});
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
}
|
||||
else {
|
||||
streamDeck.setIcon(context,src,background);
|
||||
streamDeck.setIcon(context,device,src,{background:background});
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
}
|
||||
else if (mode == 'currentCombatant'){
|
||||
if (MODULE.getPermission('COMBAT','DISPLAY_COMBATANTS') == false) {
|
||||
streamDeck.noPermission(context,device,device);
|
||||
return;
|
||||
}
|
||||
if (combat != null && combat != undefined && combat.started){
|
||||
let tokenId = combat.combatant.tokenId;
|
||||
tokenControl.pushData(tokenId,settings,context);
|
||||
const tokenId = compatibleCore("0.8.1") ? combat.combatant.data.tokenId : combat.combatant.tokenId;
|
||||
tokenControl.pushData(tokenId,settings,context,device);
|
||||
}
|
||||
else {
|
||||
streamDeck.setIcon(context,src,background);
|
||||
streamDeck.setIcon(context,device,src,{background:background});
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
}
|
||||
else if (mode == 'function'){
|
||||
|
||||
|
||||
if (ctFunction == 'turnDisplay' && MODULE.getPermission('COMBAT','TURN_DISPLAY') == false) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
else if (ctFunction == 'endTurn' && MODULE.getPermission('COMBAT','END_TURN') == false) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
else if (ctFunction != 'turnDisplay' && ctFunction != 'endTurn' && MODULE.getPermission('COMBAT','OTHER_FUNCTIONS') == false) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctFunction == 'startStop') {
|
||||
if (combat == null || combat == undefined || combat.combatants.length == 0) {
|
||||
src = "modules/MaterialDeck/img/combattracker/startcombat.png";
|
||||
@@ -81,6 +103,9 @@ export class CombatTracker{
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ctFunction == 'endTurn') {
|
||||
src = "modules/MaterialDeck/img/combattracker/nextturn.png";
|
||||
}
|
||||
else if (ctFunction == 'nextTurn') {
|
||||
src = "modules/MaterialDeck/img/combattracker/nextturn.png";
|
||||
}
|
||||
@@ -105,68 +130,69 @@ export class CombatTracker{
|
||||
if (txt != "") txt += "\n";
|
||||
if (settings.displayTurn) txt += "Turn\n"+turn;
|
||||
}
|
||||
streamDeck.setIcon(context,src,background);
|
||||
streamDeck.setIcon(context,device,src,{background:background});
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
}
|
||||
|
||||
keyPress(settings,context){
|
||||
let mode = settings.combatTrackerMode;
|
||||
if (mode == undefined) mode = 'combatants';
|
||||
|
||||
if (mode == 'function'){
|
||||
let combat = game.combat;
|
||||
if (combat == null || combat == undefined) return;
|
||||
keyPress(settings,context,device){
|
||||
const mode = settings.combatTrackerMode ? settings.combatTrackerMode : 'combatants';
|
||||
const combat = game.combat;
|
||||
|
||||
if (mode == 'function'){
|
||||
if (combat == null || combat == undefined) return;
|
||||
const ctFunction = settings.combatTrackerFunction ? settings.combatTrackerFunction : 'startStop';
|
||||
|
||||
if (ctFunction == 'turnDisplay' && MODULE.getPermission('COMBAT','TURN_DISPLAY') == false) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
else if (ctFunction == 'endTurn' && MODULE.getPermission('COMBAT','END_TURN') == false) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
else if (ctFunction != 'turnDisplay' && ctFunction != 'endTurn' && MODULE.getPermission('COMBAT','OTHER_FUNCTIONS') == false) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
|
||||
let ctFunction = settings.combatTrackerFunction;
|
||||
if (ctFunction == undefined) ctFunction == 'startStop';
|
||||
if (ctFunction == 'startStop'){
|
||||
let src;
|
||||
let background;
|
||||
if (game.combat.started){
|
||||
game.combat.endCombat();
|
||||
src = "modules/MaterialDeck/img/combattracker/startcombat.png";
|
||||
background = "#000000";
|
||||
}
|
||||
else {
|
||||
game.combat.startCombat();
|
||||
src = "modules/MaterialDeck/img/combattracker/stopcombat.png";
|
||||
background = "#FF0000";
|
||||
}
|
||||
streamDeck.setIcon(context,src,background);
|
||||
return;
|
||||
}
|
||||
if (game.combat.started == false) return;
|
||||
|
||||
|
||||
if (ctFunction == 'nextTurn') game.combat.nextTurn();
|
||||
else if (ctFunction == 'prevTurn') game.combat.previousTurn();
|
||||
else if (ctFunction == 'nextRound') game.combat.nextRound();
|
||||
else if (ctFunction == 'prevRound') game.combat.previousRound();
|
||||
else if (ctFunction == 'endTurn' && game.combat.combatant.owner) game.combat.nextTurn();
|
||||
}
|
||||
else {
|
||||
let onClick = settings.onClick;
|
||||
if (onClick == undefined) onClick = 'doNothing';
|
||||
const onClick = settings.onClick ? settings.onClick : 'doNothing';
|
||||
let tokenId;
|
||||
let combat = game.combat;
|
||||
if (mode == 'combatants') {
|
||||
if (combat != null && combat != undefined && combat.turns.length != 0){
|
||||
let initiativeOrder = combat.turns;
|
||||
const initiativeOrder = combat.turns;
|
||||
let nr = settings.combatantNr - 1;
|
||||
if (nr == undefined || nr < 1) nr = 0;
|
||||
let combatantState = 1;
|
||||
if (nr == combat.turn) combatantState = 2;
|
||||
let combatant = initiativeOrder[nr]
|
||||
|
||||
const combatant = initiativeOrder[nr]
|
||||
if (combatant == undefined) return;
|
||||
tokenId = combatant.tokenId;
|
||||
tokenId = compatibleCore("0.8.1") ? combatant.data.tokenId : combatant.tokenId;
|
||||
}
|
||||
}
|
||||
else if (mode == 'currentCombatant')
|
||||
if (combat != null && combat != undefined && combat.started)
|
||||
tokenId = combat.combatant.tokenId;
|
||||
tokenId = compatibleCore("0.8.1") ? combat.combatant.data.tokenId : combat.combatant.tokenId;
|
||||
|
||||
let token
|
||||
if (canvas.tokens.children[0] != undefined) token = canvas.tokens.children[0].children.find(p => p.id == tokenId);
|
||||
let token = (canvas.tokens.children[0] != undefined) ? canvas.tokens.children[0].children.find(p => p.id == tokenId) : undefined;
|
||||
if (token == undefined) return;
|
||||
if (onClick == 'doNothing') //Do nothing
|
||||
return;
|
||||
@@ -178,7 +204,7 @@ export class CombatTracker{
|
||||
canvas.animatePan(location);
|
||||
}
|
||||
else if (onClick == 'centerSelect'){ //center on token and select
|
||||
let location = token.getCenter(token.x,token.y);
|
||||
const location = token.getCenter(token.x,token.y);
|
||||
canvas.animatePan(location);
|
||||
token.control();
|
||||
}
|
||||
|
||||
703
src/external.js
Normal file
@@ -0,0 +1,703 @@
|
||||
import {streamDeck} from "../MaterialDeck.js";
|
||||
|
||||
export class ExternalModules{
|
||||
constructor(){
|
||||
this.active = false;
|
||||
this.gmScreenOpen = false;
|
||||
}
|
||||
|
||||
async updateAll(data={}){
|
||||
if (data.gmScreen != undefined){
|
||||
this.gmScreenOpen = data.gmScreen.isOpen;
|
||||
}
|
||||
if (this.active == false) return;
|
||||
for (let device of streamDeck.buttonContext) {
|
||||
if (device?.buttons == undefined) continue;
|
||||
for (let i=0; i<device.buttons.length; i++){
|
||||
const data = device.buttons[i];
|
||||
if (data == undefined || data.action != 'external') continue;
|
||||
await this.update(data.settings,data.context,device.device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(settings,context,device){
|
||||
this.active = true;
|
||||
const module = settings.module ? settings.module : 'fxmaster';
|
||||
|
||||
if (module == 'fxmaster') this.updateFxMaster(settings,context,device);
|
||||
else if (module == 'gmscreen') this.updateGMScreen(settings,context,device);
|
||||
else if (module == 'triggerHappy') this.updateTriggerHappy(settings,context,device);
|
||||
else if (module == 'sharedVision') this.updateSharedVision(settings,context,device);
|
||||
else if (module == 'mookAI') this.updateMookAI(settings,context,device);
|
||||
else if (module == 'notYourTurn') this.updateNotYourTurn(settings,context,device);
|
||||
else if (module == 'lockView') this.updateLockView(settings,context,device);
|
||||
else if (module == 'aboutTime') this.updateAboutTime(settings,context,device);
|
||||
}
|
||||
|
||||
keyPress(settings,context,device){
|
||||
if (this.active == false) return;
|
||||
const module = settings.module ? settings.module : 'fxmaster';
|
||||
|
||||
if (module == 'fxmaster') this.keyPressFxMaster(settings,context,device);
|
||||
else if (module == 'gmscreen') this.keyPressGMScreen(settings,context,device);
|
||||
else if (module == 'triggerHappy') this.keyPressTriggerHappy(settings,context,device);
|
||||
else if (module == 'sharedVision') this.keyPressSharedVision(settings,context,device);
|
||||
else if (module == 'mookAI') this.keyPressMookAI(settings,context,device);
|
||||
else if (module == 'notYourTurn') this.keyPressNotYourTurn(settings,context,device);
|
||||
else if (module == 'lockView') this.keyPressLockView(settings,context,device);
|
||||
else if (module == 'aboutTime') this.keyPressAboutTime(settings,context,device);
|
||||
}
|
||||
|
||||
getModuleEnable(moduleId){
|
||||
const module = game.modules.get(moduleId);
|
||||
if (module == undefined || module.active == false) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//FxMaster
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
updateFxMaster(settings,context,device){
|
||||
if (game.user.isGM == false) return;
|
||||
const fxmaster = game.modules.get("fxmaster");
|
||||
if (fxmaster == undefined || fxmaster.active == false) return;
|
||||
|
||||
const type = (settings.fxMasterType == undefined) ? 'weatherControls' : settings.fxMasterType;
|
||||
const displayIcon = settings.displayFxMasterIcon;
|
||||
const displayName = settings.displayFxMasterName;
|
||||
let ring = 0;
|
||||
let ringColor = "#000000";
|
||||
let background = "#000000"
|
||||
|
||||
let icon = '';
|
||||
let name = '';
|
||||
if (type == 'weatherControls') {
|
||||
const effect = (settings.weatherEffect == undefined) ? 'leaves' : settings.weatherEffect;
|
||||
name = CONFIG.weatherEffects[effect].label;
|
||||
icon = CONFIG.weatherEffects[effect].icon;
|
||||
ring = this.findWeatherEffect(effect) != undefined ? 2 : 1;
|
||||
ringColor = ring < 2 ? '#000000' : "#00ff00";
|
||||
}
|
||||
else if (type == 'colorize') {
|
||||
background = (settings.fxMasterColorizeColor == undefined) ? '#000000' : settings.fxMasterColorizeColor;
|
||||
icon = "fas fa-palette";
|
||||
name = game.i18n.localize("MaterialDeck.FxMaster.Colorize");
|
||||
const filters = canvas.scene.getFlag("fxmaster", "filters");
|
||||
ring = 2;
|
||||
if (filters == undefined || filters['core_color'] == undefined) {
|
||||
ringColor = "#000000";
|
||||
}
|
||||
else {
|
||||
const colors = filters['core_color'].options;
|
||||
let red = Math.ceil(colors.red*255).toString(16);
|
||||
if (red.length == 1) red = '0' + red;
|
||||
let green = Math.ceil(colors.green*255).toString(16);
|
||||
if (green.length == 1) green = '0' + green;
|
||||
let blue = Math.ceil(colors.blue*255).toString(16);
|
||||
if (blue.length == 1) blue = '0' + blue;
|
||||
ringColor = "#" + red + green + blue;
|
||||
}
|
||||
}
|
||||
else if (type == 'filters') {
|
||||
const filter = (settings.fxMasterFilter == undefined) ? 'underwater' : settings.fxMasterFilter;
|
||||
name = CONFIG.fxmaster.filters[filter].label;
|
||||
background = "#340057";
|
||||
if (displayIcon){
|
||||
if (filter == 'underwater') icon = "fas fa-water";
|
||||
else if (filter == 'predator') icon = "fas fa-wave-square";
|
||||
else if (filter == 'oldfilm') icon = "fas fa-film";
|
||||
else if (filter == 'bloom') icon = "fas fa-ghost";
|
||||
}
|
||||
const fxmaster = canvas.scene.getFlag("fxmaster", "filters");
|
||||
ring = 1;
|
||||
if (fxmaster != undefined) {
|
||||
const objKeys = Object.keys(fxmaster);
|
||||
for (let i=0; i<objKeys.length; i++){
|
||||
if (objKeys[i] == "core_"+filter) {
|
||||
ring = 2;
|
||||
ringColor = "#A600FF";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == 'clear'){
|
||||
icon = "fas fa-trash";
|
||||
name = game.i18n.localize("MaterialDeck.FxMaster.Clear");
|
||||
}
|
||||
|
||||
if (displayIcon) streamDeck.setIcon(context,device,icon,{background:background,ring:ring,ringColor:ringColor});
|
||||
else streamDeck.setIcon(context,device, "", {background:background,ring:ring,ringColor:ringColor});
|
||||
if (displayName == 0) name = "";
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
|
||||
hexToRgb(hex) {
|
||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
red: parseInt(result[1], 16)/256,
|
||||
green: parseInt(result[2], 16)/256,
|
||||
blue: parseInt(result[3], 16)/256
|
||||
} : null;
|
||||
}
|
||||
|
||||
keyPressFxMaster(settings,context,device){
|
||||
if (game.user.isGM == false) return;
|
||||
const fxmaster = game.modules.get("fxmaster");
|
||||
if (fxmaster == undefined || fxmaster.active == false) return;
|
||||
|
||||
const type = (settings.fxMasterType == undefined) ? 'weatherControls' : settings.fxMasterType;
|
||||
|
||||
if (type == 'weatherControls') {
|
||||
const effect = (settings.weatherEffect == undefined) ? 'leaves' : settings.weatherEffect;
|
||||
let exists = false;
|
||||
let newEffects = {};
|
||||
let effects = canvas.scene.getFlag("fxmaster", "effects");
|
||||
if (effects != undefined){
|
||||
const weatherIds = Object.keys(effects);
|
||||
for (let i=0; i<weatherIds.length; i++){
|
||||
const weather = effects[weatherIds[i]].type;
|
||||
if (weather === effect) {
|
||||
exists = true;
|
||||
continue;
|
||||
}
|
||||
newEffects[weatherIds[i]] = effects[weatherIds[i]];
|
||||
}
|
||||
}
|
||||
|
||||
const density = (settings.densitySlider == undefined) ? 50 : settings.densitySlider;
|
||||
const speed = (settings.speedSlider == undefined) ? 50 : settings.speedSlider;
|
||||
const direction = (settings.directionSlider == undefined) ? 50 : settings.directionSlider;
|
||||
const scale = (settings.scaleSlider == undefined) ? 50 : settings.scaleSlider;
|
||||
const color = (settings.fxMasterWeatherColor == undefined) ? "#000000" : settings.fxMasterWeatherColor;
|
||||
const applyColor = (settings.fxWeatherEnColor == undefined) ? false : settings.fxWeatherEnColor;
|
||||
|
||||
if (exists == false) {
|
||||
newEffects[randomID()] = {
|
||||
type: effect,
|
||||
options: {
|
||||
density: density,
|
||||
speed: speed,
|
||||
scale: scale,
|
||||
tint: color,
|
||||
direction: direction,
|
||||
apply_tint: applyColor
|
||||
}
|
||||
};
|
||||
}
|
||||
canvas.scene.unsetFlag("fxmaster", "effects").then(() => {
|
||||
canvas.scene.setFlag("fxmaster", "effects", newEffects);
|
||||
});
|
||||
|
||||
}
|
||||
else if (type == 'colorize') {
|
||||
const color = (settings.fxMasterColorizeColor == undefined) ? '#000000' : settings.fxMasterColorizeColor;
|
||||
const filters = canvas.scene.getFlag("fxmaster", "filters");
|
||||
let newFilters = {};
|
||||
if (filters != undefined){
|
||||
const filterObjects = Object.keys(filters);
|
||||
for (let i=0; i<filterObjects.length; i++){
|
||||
if (filterObjects[i] == 'core_color'){
|
||||
//continue;
|
||||
}
|
||||
newFilters[filterObjects[i]] = filters[filterObjects[i]];
|
||||
}
|
||||
}
|
||||
newFilters['core_color'] = {
|
||||
type : 'color',
|
||||
options: this.hexToRgb(color)
|
||||
};
|
||||
|
||||
canvas.scene.unsetFlag("fxmaster", "filters").then(() => {
|
||||
canvas.scene.setFlag("fxmaster", "filters", newFilters);
|
||||
});
|
||||
|
||||
}
|
||||
else if (type == 'filters') {
|
||||
const filter = (settings.fxMasterFilter == undefined) ? 'underwater' : settings.fxMasterFilter;
|
||||
const filters = canvas.scene.getFlag("fxmaster", "filters");
|
||||
let newFilters = {};
|
||||
let exists = false;
|
||||
if (filters != undefined){
|
||||
const filterObjects = Object.keys(filters);
|
||||
for (let i=0; i<filterObjects.length; i++){
|
||||
if (filterObjects[i] == 'core_'+filter){
|
||||
exists = true;
|
||||
continue;
|
||||
}
|
||||
newFilters[filterObjects[i]] = filters[filterObjects[i]];
|
||||
}
|
||||
|
||||
}
|
||||
if (exists == false) {
|
||||
newFilters['core_'+filter] = {type : filter};
|
||||
}
|
||||
canvas.scene.unsetFlag("fxmaster", "filters").then(() => {
|
||||
canvas.scene.setFlag("fxmaster", "filters", newFilters);
|
||||
});
|
||||
}
|
||||
else if (type == 'clear'){
|
||||
canvas.scene.unsetFlag("fxmaster", "filters");
|
||||
canvas.scene.unsetFlag("fxmaster", "effects");
|
||||
}
|
||||
}
|
||||
|
||||
findWeatherEffect(effect){
|
||||
const effects = canvas.scene.getFlag("fxmaster", "effects");
|
||||
if (effects == undefined) return undefined;
|
||||
|
||||
const weatherIds = Object.keys(effects);
|
||||
for (let i = 0; i < weatherIds.length; ++i) {
|
||||
const weather = effects[weatherIds[i]].type;
|
||||
if (weather === effect) return weatherIds[i];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//GM Screen
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
updateGMScreen(settings,context,device){
|
||||
if (this.getModuleEnable("gm-screen") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const background = settings.gmScreenBackground ? settings.gmScreenBackground : '#000000';
|
||||
let ring = 1;
|
||||
const ringColor = '#00FF00'
|
||||
let src = '';
|
||||
let txt = '';
|
||||
|
||||
if (this.gmScreenOpen) ring = 2;
|
||||
|
||||
if (settings.displayGmScreenIcon) src = "fas fa-book-reader";
|
||||
streamDeck.setIcon(context,device,src,{background:background,ring:ring,ringColor:ringColor});
|
||||
if (settings.displayGmScreenName) txt = game.i18n.localize(`GMSCR.gmScreen.Open`);
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
|
||||
keyPressGMScreen(settings,context,device){
|
||||
if (this.getModuleEnable("gm-screen") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
window['gm-screen'].toggleGmScreenVisibility();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Trigger Happy
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
updateTriggerHappy(settings,context,device) {
|
||||
if (this.getModuleEnable("trigger-happy") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const displayName = settings.displayTriggerHappyName ? settings.displayTriggerHappyName : false;
|
||||
const displayIcon = settings.displayTriggerHappyIcon ? settings.displayTriggerHappyIcon : false;
|
||||
|
||||
const background = "#340057";
|
||||
const ringColor = game.settings.get("trigger-happy", "enableTriggers") ? "#A600FF" : "#340057";
|
||||
|
||||
let txt = '';
|
||||
if (displayIcon) streamDeck.setIcon(context,device,"fas fa-grin-squint-tears",{background:background,ring:2,ringColor:ringColor});
|
||||
else streamDeck.setIcon(context,device,'',{background:'#000000'});
|
||||
if (displayName) txt = 'Trigger Happy';
|
||||
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
|
||||
keyPressTriggerHappy(settings,context,device){
|
||||
if (this.getModuleEnable("trigger-happy") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
const mode = settings.triggerHappyMode ? settings.triggerHappyMode : 'toggle';
|
||||
|
||||
let val = game.settings.get("trigger-happy", "enableTriggers");
|
||||
if (mode == 'toggle') val = !val;
|
||||
else if (mode == 'enable') val = true;
|
||||
else if (mode == 'disable') val = false;
|
||||
|
||||
game.settings.set("trigger-happy", "enableTriggers", val);
|
||||
|
||||
const control = ui.controls.controls.find(c => c.name == 'token');
|
||||
if (control == undefined) return;
|
||||
let tool = control.tools.find(t => t.name == 'triggers');
|
||||
if (tool == undefined) return;
|
||||
tool.active = val;
|
||||
ui.controls.render();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Shared Vision
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
updateSharedVision(settings,context,device) {
|
||||
if (this.getModuleEnable("SharedVision") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const displayName = settings.sharedVisionName ? settings.sharedVisionName : false;
|
||||
const displayIcon = settings.sharedVisionIcon ? settings.sharedVisionIcon : false;
|
||||
|
||||
const background = "#340057";
|
||||
const ringColor = game.settings.get("SharedVision", "enable") ? "#A600FF" : "#340057";
|
||||
|
||||
let txt = '';
|
||||
if (displayIcon) streamDeck.setIcon(context,device,"fas fa-eye",{background:background,ring:2,ringColor:ringColor});
|
||||
else streamDeck.setIcon(context,device,'',{background:'#000000'});
|
||||
if (displayName) txt = 'Shared Vision';
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
|
||||
keyPressSharedVision(settings,context,device) {
|
||||
if (this.getModuleEnable("SharedVision") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const mode = settings.sharedVisionMode ? settings.sharedVisionMode : 'toggle';
|
||||
|
||||
if (mode == 'toggle') Hooks.call("setShareVision",{enable:'toggle'});
|
||||
else if (mode == 'enable') Hooks.call("setShareVision",{enable:true});
|
||||
else if (mode == 'disable') Hooks.call("setShareVision",{enable:false});
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Mook AI
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
updateMookAI(settings,context,device) {
|
||||
if (this.getModuleEnable("mookAI") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const displayName = settings.mookName ? settings.mookName : false;
|
||||
const displayIcon = settings.mookIcon ? settings.mookIcon : false;
|
||||
|
||||
const background = "#000000";
|
||||
|
||||
let txt = '';
|
||||
if (displayIcon) streamDeck.setIcon(context,device,"fas fa-brain",{background:'#000000'});
|
||||
else streamDeck.setIcon(context,device,'',{background:'#000000'});
|
||||
if (displayName) txt = 'Mook AI';
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
|
||||
async keyPressMookAI(settings,context,device) {
|
||||
if (this.getModuleEnable("mookAI") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
let mook = await import('../../mookAI/scripts/mookAI.js');
|
||||
let mookAI = new mook.MookAI ();
|
||||
mookAI.takeNextTurn();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Not Your Turn!
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
updateNotYourTurn(settings,context,device) {
|
||||
|
||||
if (this.getModuleEnable("NotYourTurn") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const mode = settings.notYourTurnMode ? settings.notYourTurnMode : 'toggle';
|
||||
const displayName = settings.notYourTurnName ? settings.notYourTurnName : false;
|
||||
const displayIcon = settings.notYourTurnIcon ? settings.notYourTurnIcon : false;
|
||||
|
||||
const background = "#340057";
|
||||
let ringColor = "#340057" ;
|
||||
|
||||
let txt = '';
|
||||
let icon = '';
|
||||
if (mode == 'toggle' || mode == 'enable' || mode == 'disable') {
|
||||
icon = "fas fa-fist-raised";
|
||||
txt = "Block Combat Movement";
|
||||
ringColor = game.settings.get('NotYourTurn','enable') ? "#A600FF": "#340057" ;
|
||||
}
|
||||
else {
|
||||
icon = "fas fa-lock";
|
||||
txt = "Block Non-Combat Movement";
|
||||
ringColor = game.settings.get('NotYourTurn','nonCombat') ? "#A600FF": "#340057" ;
|
||||
}
|
||||
if (displayIcon) streamDeck.setIcon(context,device,icon,{background:background,ring:2,ringColor:ringColor});
|
||||
else streamDeck.setIcon(context,device,'',{background:'#000000'});
|
||||
if (displayName == false) txt = '';
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
|
||||
async keyPressNotYourTurn(settings,context,device) {
|
||||
if (this.getModuleEnable("NotYourTurn") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const mode = settings.notYourTurnMode ? settings.notYourTurnMode : 'toggle';
|
||||
|
||||
if (mode == 'toggle') Hooks.call("setNotYourTurn",{combat:'toggle'});
|
||||
else if (mode == 'enable') Hooks.call("setNotYourTurn",{combat:true});
|
||||
else if (mode == 'disable') Hooks.call("setNotYourTurn",{combat:false});
|
||||
else if (mode == 'toggleNonCombat') Hooks.call("setNotYourTurn",{nonCombat:'toggle'});
|
||||
else if (mode == 'enableNonCombat') Hooks.call("setNotYourTurn",{nonCombat:true});
|
||||
else if (mode == 'disableNonCombat') Hooks.call("setNotYourTurn",{nonCombat:false});
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Lock View
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
updateLockView(settings,context,device) {
|
||||
|
||||
if (this.getModuleEnable("LockView") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const mode = settings.lockViewMode ? settings.lockViewMode : 'panLock';
|
||||
const displayName = settings.lockViewName ? settings.lockViewName : false;
|
||||
const displayIcon = settings.lockViewIcon ? settings.lockViewIcon : false;
|
||||
|
||||
const background = "#340057";
|
||||
let ringColor = "#340057" ;
|
||||
|
||||
let txt = '';
|
||||
let icon = '';
|
||||
if (mode == 'panLock') {
|
||||
icon = "fas fa-arrows-alt";
|
||||
txt = "Pan Lock";
|
||||
ringColor = canvas.scene.getFlag('LockView', 'lockPan') ? "#A600FF": "#340057" ;
|
||||
}
|
||||
else if (mode == 'zoomLock') {
|
||||
icon = "fas fa-search-plus";
|
||||
txt = "Zoom Lock";
|
||||
ringColor = canvas.scene.getFlag('LockView', 'lockZoom') ? "#A600FF": "#340057" ;
|
||||
}
|
||||
else if (mode == 'boundingBox') {
|
||||
icon = "fas fa-box";
|
||||
txt = "Bounding Box";
|
||||
ringColor = canvas.scene.getFlag('LockView', 'boundingBox') ? "#A600FF": "#340057" ;
|
||||
}
|
||||
|
||||
if (displayIcon) streamDeck.setIcon(context,device,icon,{background:background,ring:2,ringColor:ringColor});
|
||||
else streamDeck.setIcon(context,device,'',{background:'#000000'});
|
||||
if (displayName == false) txt = '';
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
|
||||
async keyPressLockView(settings,context,device) {
|
||||
if (this.getModuleEnable("LockView") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const mode = settings.lockViewMode ? settings.lockViewMode : 'panLock';
|
||||
let toggle = settings.lockViewToggle ? settings.lockViewToggle : 'toggle';
|
||||
if (toggle == 'enable') toggle = true;
|
||||
else if (toggle == 'disable') toggle = false;
|
||||
let msg = {};
|
||||
|
||||
if (mode == 'panLock') msg = {panLock:toggle};
|
||||
else if (mode == 'zoomLock') msg = {zoomLock:toggle};
|
||||
else if (mode == 'boundingBox') msg = {boundingBox:toggle};
|
||||
|
||||
Hooks.call("setLockView",msg);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//About Time
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
updateAboutTime(settings,context,device) {
|
||||
if (this.getModuleEnable("about-time") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const displayTime = settings.aboutTimeDisplayTime ? settings.aboutTimeDisplayTime : 'none';
|
||||
const displayDate = settings.aboutTimeDisplayDate ? settings.aboutTimeDisplayDate : 'none';
|
||||
const background = settings.aboutTimeBackground ? settings.aboutTimeBackground : '#000000';
|
||||
const ringOffColor = settings.aboutTimeOffRing ? settings.aboutTimeOffRing : '#000000';
|
||||
const ringOnColor = settings.aboutTimeOnRing ? settings.aboutTimeOnRing : '#00FF00';
|
||||
|
||||
let ring = 0;
|
||||
let ringColor = '#000000';
|
||||
let txt = '';
|
||||
let currentTime = game.Gametime.DTNow().longDateExtended();
|
||||
let clock = 'none';
|
||||
|
||||
if (displayTime == 'clock') {
|
||||
const hours = currentTime.hour > 12 ? currentTime.hour-12 : currentTime.hour;
|
||||
clock = {
|
||||
hours: hours,
|
||||
minutes: currentTime.minute
|
||||
}
|
||||
}
|
||||
else if (displayTime != 'none') {
|
||||
let hours;
|
||||
let AMPM = "";
|
||||
if ((displayTime == 'compact12h' || displayTime == 'full12h' || displayTime == 'hours12h') && currentTime.hour > 12) {
|
||||
hours = currentTime.hour - 12;
|
||||
AMPM = " PM";
|
||||
}
|
||||
else if ((displayTime == 'compact12h' || displayTime == 'full12h' || displayTime == 'hours12h') && currentTime.hour <= 12) {
|
||||
hours = currentTime.hour;
|
||||
AMPM = " AM";
|
||||
}
|
||||
else {
|
||||
hours = currentTime.hour;
|
||||
}
|
||||
if (displayTime == 'hours24h' || displayTime == 'hours12h') txt = hours;
|
||||
else if (displayTime == 'minutes') txt = currentTime.minute;
|
||||
else if (displayTime == 'seconds') txt = currentTime.second;
|
||||
else {
|
||||
if (currentTime.minute < 10) currentTime.minute = '0' + currentTime.minute;
|
||||
if (currentTime.second < 10) currentTime.second = '0' + currentTime.second;
|
||||
txt += hours + ':' + currentTime.minute;
|
||||
if (displayTime == 'full24h' || displayTime == 'full12h') txt += ':' + currentTime.second;
|
||||
}
|
||||
if (displayTime == 'compact12h' || displayTime == 'full12h' || displayTime == 'hours12h') txt += AMPM;
|
||||
}
|
||||
if (displayTime != 'none' && displayTime != 'clock' && displayDate != 'none') txt += '\n';
|
||||
|
||||
if (displayDate == 'day') txt += currentTime.day;
|
||||
else if (displayDate == 'dayName') txt += currentTime.dowString;
|
||||
else if (displayDate == 'month') txt += currentTime.month;
|
||||
else if (displayDate == 'monthName') txt += currentTime.monthString;
|
||||
else if (displayDate == 'year') txt += currentTime.year;
|
||||
else if (displayDate == 'small') txt += currentTime.day + '-' + currentTime.month;
|
||||
else if (displayDate == 'smallInv') txt += currentTime.month + '-' + currentTime.day;
|
||||
else if (displayDate == 'full') txt += currentTime.day + '-' + currentTime.month + '-' + currentTime.year;
|
||||
else if (displayDate == 'fullInv') txt += currentTime.month + '-' + currentTime.day + '-' + currentTime.year;
|
||||
else if (displayDate == 'text' || displayDate == 'textDay') {
|
||||
|
||||
if (displayDate == 'textDay') txt += currentTime.dowString + ' ';
|
||||
txt += currentTime.day;
|
||||
if (currentTime.day % 10 == 1 && currentTime != 11) txt += game.i18n.localize("MaterialDeck.AboutTime.First");
|
||||
else if (currentTime.day % 10 == 2 && currentTime != 12) txt += game.i18n.localize("MaterialDeck.AboutTime.Second");
|
||||
else if (currentTime.day % 10 == 3 && currentTime != 13) txt += game.i18n.localize("MaterialDeck.AboutTime.Third");
|
||||
else txt += game.i18n.localize("MaterialDeck.AboutTime.Fourth");
|
||||
txt += ' ' + game.i18n.localize("MaterialDeck.AboutTime.Of") + ' ' + currentTime.monthString + ', ' + currentTime.year;
|
||||
}
|
||||
|
||||
if (settings.aboutTimeActive) {
|
||||
const clockRunning = game.Gametime.isRunning();
|
||||
ringColor = clockRunning ? ringOnColor : ringOffColor;
|
||||
ring = 2;
|
||||
}
|
||||
|
||||
streamDeck.setTitle(txt,context);
|
||||
streamDeck.setIcon(context,device,'',{background:background,ring:ring,ringColor:ringColor, clock:clock});
|
||||
}
|
||||
|
||||
keyPressAboutTime(settings,context,device) {
|
||||
if (this.getModuleEnable("about-time") == false) return;
|
||||
if (game.user.isGM == false) return;
|
||||
|
||||
const onClick = settings.aboutTimeOnClick ? settings.aboutTimeOnClick : 'none';
|
||||
if (onClick == 'none') return;
|
||||
else if (onClick == 'startStop') {
|
||||
const clockRunning = game.Gametime.isRunning();
|
||||
const startMode = settings.aboutTimeStartStopMode ? settings.aboutTimeStartStopMode : 'toggle';
|
||||
if ((startMode == 'toggle' && clockRunning) || startMode == 'stop') game.Gametime.stopRunning();
|
||||
else if ((startMode == 'toggle' && !clockRunning) || startMode == 'start') game.Gametime.startRunning();
|
||||
}
|
||||
else if (onClick == 'advance') {
|
||||
const advanceMode = settings.aboutTimeAdvanceMode ? settings.aboutTimeAdvanceMode : 'dawn';
|
||||
let now = Gametime.DTNow();
|
||||
if (advanceMode == 'dawn') {
|
||||
let newDT = now.add({
|
||||
days: now.hours < 7 ? 0 : 1
|
||||
}).setAbsolute({
|
||||
hours: 7,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == 'noon') {
|
||||
let newDT = now.add({
|
||||
days: now.hours < 12 ? 0 : 1
|
||||
}).setAbsolute({
|
||||
hours: 12,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == 'dusk') {
|
||||
let newDT = now.add({
|
||||
days: now.hours < 20 ? 0 : 1
|
||||
}).setAbsolute({
|
||||
hours: 20,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == 'midnight') {
|
||||
let newDT = Gametime.DTNow().add({
|
||||
days: 1
|
||||
}).setAbsolute({
|
||||
hours: 0,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == '1s')
|
||||
game.Gametime.advanceClock(1);
|
||||
else if (advanceMode == '30s')
|
||||
game.Gametime.advanceClock(30);
|
||||
|
||||
else if (advanceMode == '1m')
|
||||
game.Gametime.advanceTime({ minutes: 1 });
|
||||
else if (advanceMode == '5m')
|
||||
game.Gametime.advanceTime({ minutes: 5 });
|
||||
else if (advanceMode == '15m')
|
||||
game.Gametime.advanceTime({ minutes: 15 });
|
||||
else if (advanceMode == '1h')
|
||||
game.Gametime.advanceTime({ hours: 1 });
|
||||
}
|
||||
else if (onClick == 'recede') {
|
||||
const advanceMode = settings.aboutTimeAdvanceMode ? settings.aboutTimeAdvanceMode : 'dawn';
|
||||
let now = Gametime.DTNow();
|
||||
if (advanceMode == 'dawn') {
|
||||
let newDT = now.add({
|
||||
days: now.hours < 7 ? -1 : 0
|
||||
}).setAbsolute({
|
||||
hours: 7,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == 'noon') {
|
||||
let newDT = now.add({
|
||||
days: now.hours < 12 ? -1 : 0
|
||||
}).setAbsolute({
|
||||
hours: 12,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == 'dusk') {
|
||||
let newDT = now.add({
|
||||
days: now.hours < 20 ? -1 : 0
|
||||
}).setAbsolute({
|
||||
hours: 20,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == 'midnight') {
|
||||
let newDT = Gametime.DTNow().add({
|
||||
days: -1
|
||||
}).setAbsolute({
|
||||
hours: 0,
|
||||
minutes: 0,
|
||||
seconds: 0
|
||||
});
|
||||
Gametime.setAbsolute(newDT);
|
||||
}
|
||||
else if (advanceMode == '1s')
|
||||
game.Gametime.advanceClock(-1);
|
||||
else if (advanceMode == '30s')
|
||||
game.Gametime.advanceClock(-30);
|
||||
|
||||
else if (advanceMode == '1m')
|
||||
game.Gametime.advanceTime({ minutes: -1 });
|
||||
else if (advanceMode == '5m')
|
||||
game.Gametime.advanceTime({ minutes: -5 });
|
||||
else if (advanceMode == '15m')
|
||||
game.Gametime.advanceTime({ minutes: -15 });
|
||||
else if (advanceMode == '1h')
|
||||
game.Gametime.advanceTime({ hours: -1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
282
src/macro.js
@@ -1,5 +1,6 @@
|
||||
import * as MODULE from "../MaterialDeck.js";
|
||||
import {streamDeck} from "../MaterialDeck.js";
|
||||
import {compatibleCore} from "./misc.js";
|
||||
|
||||
export class MacroControl{
|
||||
constructor(){
|
||||
@@ -9,159 +10,190 @@ export class MacroControl{
|
||||
|
||||
async updateAll(){
|
||||
if (this.active == false) return;
|
||||
for (let i=0; i<32; i++){
|
||||
let data = streamDeck.buttonContext[i];
|
||||
if (data == undefined || data.action != 'macro') continue;
|
||||
await this.update(data.settings,data.context);
|
||||
for (let device of streamDeck.buttonContext) {
|
||||
if (device?.buttons == undefined) continue;
|
||||
for (let i=0; i<device.buttons.length; i++){
|
||||
const data = device.buttons[i];
|
||||
if (data == undefined || data.action != 'macro') continue;
|
||||
await this.update(data.settings,data.context,device.device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(settings,context){
|
||||
async update(settings,context,device){
|
||||
this.active = true;
|
||||
let mode = settings.macroMode;
|
||||
let displayName = settings.displayName;
|
||||
const mode = settings.macroMode ? settings.macroMode : 'hotbar';
|
||||
const displayName = settings.displayName ? settings.displayName : false;
|
||||
const displayIcon = settings.displayIcon ? settings.displayIcon : false;
|
||||
const displayUses = settings.displayUses ? settings.displayUses : false;
|
||||
let background = settings.background ? settings.background : '#000000';
|
||||
let macroNumber = settings.macroNumber;
|
||||
let background = settings.background;
|
||||
let icon = false;
|
||||
if (settings.displayIcon) icon = true;
|
||||
if (macroNumber == undefined || isNaN(parseInt(macroNumber))) macroNumber = 0;
|
||||
macroNumber = parseInt(macroNumber);
|
||||
|
||||
let ringColor = "#000000";
|
||||
let ring = 0;
|
||||
if(macroNumber == undefined || isNaN(parseInt(macroNumber))){
|
||||
macroNumber = 0;
|
||||
}
|
||||
if (mode == undefined) mode = 'hotbar';
|
||||
if (displayName == undefined) displayName = false;
|
||||
if (background == undefined) background = '#000000';
|
||||
|
||||
macroNumber = parseInt(macroNumber);
|
||||
let name = "";
|
||||
let src = "";
|
||||
let macroId = undefined;
|
||||
let uses = undefined;
|
||||
|
||||
if (mode == 'macroBoard') { //Macro board
|
||||
let name = "";
|
||||
let src = '';
|
||||
if ((MODULE.getPermission('MACRO','MACROBOARD') == false )) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
if (settings.macroBoardMode == 'offset') { //Offset
|
||||
let ringOffColor = settings.offRing;
|
||||
if (ringOffColor == undefined) ringOffColor = '#000000';
|
||||
|
||||
let ringOnColor = settings.onRing;
|
||||
if (ringOnColor == undefined) ringOnColor = '#00FF00';
|
||||
|
||||
const ringOffColor = settings.offRing ? settings.offRing : '#000000';
|
||||
const ringOnColor = settings.onRing ? settings.onRing : '#00FF00';
|
||||
|
||||
let macroOffset = parseInt(settings.macroOffset);
|
||||
if (macroOffset == undefined || isNaN(macroOffset)) macroOffset = 0;
|
||||
|
||||
if (macroOffset == parseInt(this.offset)) ringColor = ringOnColor;
|
||||
else ringColor = ringOffColor;
|
||||
|
||||
ringColor = (macroOffset == parseInt(this.offset)) ? ringOnColor : ringOffColor;
|
||||
ring = 2;
|
||||
//streamDeck.setIcon(context, "", background,ring,ringColor);
|
||||
src = "modules/MaterialDeck/img/transparant.png";
|
||||
}
|
||||
else { //Execute macro
|
||||
macroNumber += this.offset - 1;
|
||||
if (macroNumber < 0) macroNumber = 0;
|
||||
var macroId = game.settings.get(MODULE.moduleName,'macroSettings').macros[macroNumber];
|
||||
macroId = game.settings.get(MODULE.moduleName,'macroSettings').macros[macroNumber];
|
||||
background = game.settings.get(MODULE.moduleName,'macroSettings').color[macroNumber];
|
||||
|
||||
if (background == undefined) background = '#000000';
|
||||
src = "";
|
||||
if (macroId != undefined){
|
||||
let macro = game.macros._source.find(p => p._id == macroId);
|
||||
if (macro != undefined) {
|
||||
name += macro.name;
|
||||
src += macro.img;
|
||||
}
|
||||
}
|
||||
ring = 0;
|
||||
}
|
||||
if (icon) streamDeck.setIcon(context,src,background,ring,ringColor);
|
||||
else streamDeck.setIcon(context, "", background,ring,ringColor);
|
||||
if (displayName == 0) name = "";
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
|
||||
else if (mode == 'name') { //macro by name
|
||||
const macroName = settings.macroNumber;
|
||||
const macro = game.macros.getName(macroName);
|
||||
macroId = macro?.id;
|
||||
}
|
||||
else { //Macro Hotbar
|
||||
let macroId
|
||||
if ((MODULE.getPermission('MACRO','HOTBAR') == false )) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
if (mode == 'hotbar') macroId = game.user.data.hotbar[macroNumber];
|
||||
else {
|
||||
let macros = game.macros.apps[0].macros;
|
||||
for (let j=0; j<10; j++){
|
||||
if (macros[j].key == macroNumber){
|
||||
if (macros[j].macro == null) macroId == undefined;
|
||||
else macroId = macros[j].macro._id;
|
||||
}
|
||||
}
|
||||
}
|
||||
let src = "";
|
||||
let name = "";
|
||||
let macros;
|
||||
if (mode == 'customHotbar' && game.modules.get('custom-hotbar') != undefined)
|
||||
macros = ui.customHotbar.macros;
|
||||
else
|
||||
macros = game.macros.apps[0].macros;
|
||||
if (macroNumber > 9) macroNumber = 0;
|
||||
macroId = game.macros.apps[0].macros.find(m => m.key == macroNumber).macro?.id
|
||||
}
|
||||
}
|
||||
|
||||
if (macroId != undefined){
|
||||
let macro = game.macros._source.find(p => p._id == macroId);
|
||||
if (macro != undefined) {
|
||||
name += macro.name;
|
||||
src += macro.img;
|
||||
}
|
||||
if (macroId != undefined){
|
||||
let macro = game.macros._source.find(p => p._id == macroId);
|
||||
|
||||
if (macro != undefined) {
|
||||
if (displayName) name = macro.name;
|
||||
if (displayIcon) src = macro.img;
|
||||
if (MODULE.hotbarUses && displayUses) uses = await this.getUses(macro);
|
||||
}
|
||||
if (icon) streamDeck.setIcon(context,src,background);
|
||||
else streamDeck.setIcon(context, "", background);
|
||||
if (displayName == 0) name = "";
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
else {
|
||||
if (displayName) name = "";
|
||||
if (displayIcon) src = "modules/MaterialDeck/img/black.png";
|
||||
}
|
||||
|
||||
streamDeck.setIcon(context,device,src,{background:background,ring:ring,ringColor:ringColor,uses:uses});
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
|
||||
hotbar(macros){
|
||||
for (let i=0; i<32; i++){
|
||||
let data = streamDeck.buttonContext[i];
|
||||
if (data == undefined || data.action != 'macro' || data.settings.macroMode == 'macroBoard') continue;
|
||||
let context = data.context;
|
||||
let mode = data.settings.macroMode;
|
||||
let displayName = data.settings.displayName;
|
||||
let macroNumber = data.settings.macroNumber;
|
||||
let background = data.settings.background;
|
||||
let src = "";
|
||||
let name = "";
|
||||
if(macroNumber == undefined || isNaN(parseInt(macroNumber))){
|
||||
macroNumber = 1;
|
||||
}
|
||||
if (mode == undefined) mode = 0;
|
||||
if (mode == 2) continue;
|
||||
if (displayName == undefined) displayName = false;
|
||||
if (background == undefined) background = '#000000';
|
||||
async getUses(macro) {
|
||||
let hbUses = await import('../../illandril-hotbar-uses/scripts/item-system.js');
|
||||
const command = macro.command;
|
||||
const uses = await hbUses.calculateUses(command);
|
||||
return uses;
|
||||
}
|
||||
|
||||
async hotbar(){
|
||||
for (let device of streamDeck.buttonContext) {
|
||||
if (device?.buttons == undefined) continue;
|
||||
for (let i=0; i<device.buttons.length; i++){
|
||||
const data = device.buttons[i];
|
||||
if (data == undefined || data.action != 'macro' || data.settings.macroMode == 'macroBoard') continue;
|
||||
|
||||
let macroId;
|
||||
if (mode == 0){
|
||||
macroId = game.user.data.hotbar[macroNumber];
|
||||
}
|
||||
else {
|
||||
for (let j=0; j<10; j++){
|
||||
if (macros[j].key == macroNumber){
|
||||
if (macros[j].macro == null) macroId == undefined;
|
||||
else macroId = macros[j].macro._id;
|
||||
}
|
||||
const context = data.context;
|
||||
const mode = data.settings.macroMode ? data.settings.macroMode : 'hotbar';
|
||||
const displayName = data.settings.displayName ? data.settings.displayName : false;
|
||||
const displayIcon = data.settings.displayIcon ? data.settings.displayIcon : false;
|
||||
const displayUses = data.settings.displayUses ? data.settings.displayUses : false;
|
||||
let background = data.settings.background ? data.settings.background : '#000000';
|
||||
let macroNumber = data.settings.macroNumber;
|
||||
if(macroNumber == undefined || isNaN(parseInt(macroNumber))) macroNumber = 1;
|
||||
|
||||
if ((MODULE.getPermission('MACRO','HOTBAR') == false )) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
|
||||
let src = "";
|
||||
let name = "";
|
||||
|
||||
if (mode == 'Macro Board') continue;
|
||||
|
||||
let macroId;
|
||||
if (mode == 'hotbar'){
|
||||
macroId = game.user.data.hotbar[macroNumber];
|
||||
}
|
||||
else {
|
||||
if (macroNumber > 9) macroNumber = 0;
|
||||
macroId = game.macros.apps[0].macros.find(m => m.key == macroNumber).macro?.id
|
||||
}
|
||||
let macro = undefined;
|
||||
let uses = undefined;
|
||||
if (macroId != undefined) macro = game.macros._source.find(p => p._id == macroId);
|
||||
if (macro != undefined && macro != null) {
|
||||
if (displayName) name += macro.name;
|
||||
if (displayIcon) src += macro.img;
|
||||
if (MODULE.hotbarUses && displayUses) uses = await this.getUses(macro);
|
||||
}
|
||||
streamDeck.setIcon(context,device,src,{background:background,uses:uses});
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
let macro = undefined;
|
||||
if (macroId != undefined) macro = game.macros._source.find(p => p._id == macroId);
|
||||
if (macro != undefined && macro != null) {
|
||||
name += macro.name;
|
||||
src += macro.img;
|
||||
}
|
||||
streamDeck.setIcon(context,src,background);
|
||||
if (displayName == 0) name = "";
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
}
|
||||
|
||||
keyPress(settings){
|
||||
let mode = settings.macroMode;
|
||||
if (mode == undefined) mode = 'hotbar';
|
||||
|
||||
const mode = settings.macroMode ? settings.macroMode : 'hotbar';
|
||||
let macroNumber = settings.macroNumber;
|
||||
if(macroNumber == undefined || isNaN(parseInt(macroNumber))){
|
||||
macroNumber = 0;
|
||||
}
|
||||
|
||||
if (mode == 'hotbar' || mode == 'visibleHotbar')
|
||||
if(macroNumber == undefined || isNaN(parseInt(macroNumber))) macroNumber = 0;
|
||||
let target = settings.target ? settings.target : undefined;
|
||||
|
||||
if (mode == 'hotbar' || mode == 'visibleHotbar' || mode == 'customHotbar'){
|
||||
if ((MODULE.getPermission('MACRO','HOTBAR') == false )) return;
|
||||
this.executeHotbar(macroNumber,mode);
|
||||
}
|
||||
else if (mode == 'name') {
|
||||
if ((MODULE.getPermission('MACRO','BY_NAME') == false )) return;
|
||||
const macroName = settings.macroNumber;
|
||||
const macro = game.macros.getName(macroName);
|
||||
|
||||
if (macro == undefined) return;
|
||||
|
||||
const args = settings.macroArgs ? settings.macroArgs : "";
|
||||
|
||||
let furnaceEnabled = false;
|
||||
let furnace = game.modules.get("furnace");
|
||||
if (furnace != undefined && furnace.active && compatibleCore("0.8.1")==false) furnaceEnabled = true;
|
||||
if (args == "" || args == " ") furnaceEnabled = false;
|
||||
if (furnaceEnabled == false) macro.execute({token:target});
|
||||
else {
|
||||
let chatData = {
|
||||
user: game.user._id,
|
||||
speaker: ChatMessage.getSpeaker(),
|
||||
content: "/'" + macro.name + "' " + args
|
||||
};
|
||||
ChatMessage.create(chatData, {});
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
if ((MODULE.getPermission('MACRO','MACROBOARD') == false )) return;
|
||||
if (settings.macroBoardMode == 'offset') {
|
||||
let macroOffset = settings.macroOffset;
|
||||
if (macroOffset == undefined) macroOffset = 0;
|
||||
@@ -175,15 +207,15 @@ export class MacroControl{
|
||||
|
||||
executeHotbar(macroNumber,mode){
|
||||
let macroId
|
||||
if (mode == 0) macroId = game.user.data.hotbar[macroNumber];
|
||||
if (mode == 'hotbar') macroId = game.user.data.hotbar[macroNumber];
|
||||
else {
|
||||
let macros = game.macros.apps[0].macros;
|
||||
for (let j=0; j<10; j++){
|
||||
if (macros[j].key == macroNumber){
|
||||
if (macros[j].macro == null) macroId == undefined;
|
||||
else macroId = macros[j].macro._id;
|
||||
}
|
||||
let macros;
|
||||
if (mode == 'customHotbar' && game.modules.get('custom-hotbar') != undefined) {
|
||||
macros = ui.customHotbar.macros;
|
||||
}
|
||||
else macros = game.macros.apps[0].macros;
|
||||
if (macroNumber > 9) macroNumber = 0;
|
||||
macroId = game.macros.apps[0].macros.find(m => m.key == macroNumber).macro?.id
|
||||
}
|
||||
if (macroId == undefined) return;
|
||||
let macro = game.macros.get(macroId);
|
||||
@@ -202,7 +234,7 @@ export class MacroControl{
|
||||
const args = game.settings.get(MODULE.moduleName,'macroSettings').args;
|
||||
let furnaceEnabled = false;
|
||||
let furnace = game.modules.get("furnace");
|
||||
if (furnace != undefined && furnace.active) furnaceEnabled = true;
|
||||
if (furnace != undefined && furnace.active && compatibleCore("0.8.1")==false) furnaceEnabled = true;
|
||||
if (args == undefined || args[macroNumber] == undefined || args[macroNumber] == "") furnaceEnabled = false;
|
||||
if (furnaceEnabled == false) macro.execute();
|
||||
else {
|
||||
@@ -216,14 +248,4 @@ export class MacroControl{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
1020
src/misc.js
132
src/move.js
@@ -1,132 +0,0 @@
|
||||
import * as MODULE from "../MaterialDeck.js";
|
||||
import {streamDeck} from "../MaterialDeck.js";
|
||||
|
||||
export class Move{
|
||||
constructor(){
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
update(settings,context){
|
||||
let background;
|
||||
if (settings.background) background = settings.background;
|
||||
else background = '#000000';
|
||||
|
||||
let url = '';
|
||||
if (settings.dir == 'center') //center
|
||||
url = "modules/MaterialDeck/img/move/center.png";
|
||||
else if (settings.dir == 'up') //up
|
||||
url = "modules/MaterialDeck/img/move/up.png";
|
||||
else if (settings.dir == 'down') //down
|
||||
url = "modules/MaterialDeck/img/move/down.png";
|
||||
else if (settings.dir == 'right') //right
|
||||
url = "modules/MaterialDeck/img/move/right.png";
|
||||
else if (settings.dir == 'left') //left
|
||||
url = "modules/MaterialDeck/img/move/left.png";
|
||||
else if (settings.dir == 'upRight')
|
||||
url = "modules/MaterialDeck/img/move/upright.png";
|
||||
else if (settings.dir == 'upLeft')
|
||||
url = "modules/MaterialDeck/img/move/upleft.png";
|
||||
else if (settings.dir == 'downRight')
|
||||
url = "modules/MaterialDeck/img/move/downright.png";
|
||||
else if (settings.dir == 'downLeft')
|
||||
url = "modules/MaterialDeck/img/move/downleft.png";
|
||||
else if (settings.dir == 'zoomIn')
|
||||
url = "modules/MaterialDeck/img/move/zoomin.png";
|
||||
else if (settings.dir == 'zoomOut')
|
||||
url = "modules/MaterialDeck/img/move/zoomout.png";
|
||||
streamDeck.setIcon(context,url,background);
|
||||
}
|
||||
keyPress(settings){
|
||||
if (canvas.scene == null) return;
|
||||
let dir = settings.dir;
|
||||
let mode = settings.mode;
|
||||
if (mode == undefined) mode = 'canvas';
|
||||
if (dir == undefined) dir = 'center';
|
||||
|
||||
if (dir == 'zoomIn') {//zoom in
|
||||
let viewPosition = canvas.scene._viewPosition;
|
||||
viewPosition.scale = viewPosition.scale*1.05;
|
||||
viewPosition.duration = 100;
|
||||
canvas.animatePan(viewPosition);
|
||||
}
|
||||
else if (dir == 'zoomOut') {//zoom out
|
||||
let viewPosition = canvas.scene._viewPosition;
|
||||
viewPosition.scale = viewPosition.scale*0.95;
|
||||
viewPosition.duration = 100;
|
||||
canvas.animatePan(viewPosition);
|
||||
}
|
||||
else {
|
||||
if (settings.mode == 'selectedToken')
|
||||
this.moveToken(MODULE.selectedTokenId,dir);
|
||||
else
|
||||
this.moveCanvas(dir);
|
||||
}
|
||||
}
|
||||
|
||||
async moveToken(tokenId,dir){
|
||||
if (tokenId == undefined) return;
|
||||
const token = canvas.tokens.children[0].children.find(p => p.id == tokenId);
|
||||
const gridSize = canvas.scene.data.grid;
|
||||
let x = token.x;
|
||||
let y = token.y;
|
||||
|
||||
if (dir == 'up') y -= gridSize;
|
||||
else if (dir == 'down') y += gridSize;
|
||||
else if (dir == 'right') x += gridSize;
|
||||
else if (dir == 'left') x -= gridSize;
|
||||
else if (dir == 'upRight') {
|
||||
x += gridSize;
|
||||
y -= gridSize;
|
||||
}
|
||||
else if (dir == 'upLeft') {
|
||||
x -= gridSize;
|
||||
y -= gridSize;
|
||||
}
|
||||
else if (dir == 'downRight') {
|
||||
x += gridSize;
|
||||
y += gridSize;
|
||||
}
|
||||
else if (dir == 'downLeft') {
|
||||
x -= gridSize;
|
||||
y += gridSize;
|
||||
}
|
||||
else if (dir == 'center') {
|
||||
let location = token.getCenter(x,y);
|
||||
canvas.animatePan(location);
|
||||
}
|
||||
if (game.user.isGM == false && (token.can(game.user,"control") == false || token.checkCollision(token.getCenter(x, y)))) return;
|
||||
token.update({x:x,y:y});
|
||||
};
|
||||
|
||||
moveCanvas(dir){
|
||||
let viewPosition = canvas.scene._viewPosition;
|
||||
const gridSize = canvas.scene.data.grid;
|
||||
viewPosition.duration = 100;
|
||||
|
||||
if (dir == 'up') viewPosition.y -= gridSize;
|
||||
else if (dir == 'down') viewPosition.y += gridSize;
|
||||
else if (dir == 'right') viewPosition.x += gridSize;
|
||||
else if (dir == 'left') viewPosition.x -= gridSize;
|
||||
else if (dir == 'upRight') {
|
||||
viewPosition.x += gridSize;
|
||||
viewPosition.y -= gridSize;
|
||||
}
|
||||
else if (dir == 'upLeft') {
|
||||
viewPosition.x -= gridSize;
|
||||
viewPosition.y -= gridSize;
|
||||
}
|
||||
else if (dir == 'downRight') {
|
||||
viewPosition.x += gridSize;
|
||||
viewPosition.y += gridSize;
|
||||
}
|
||||
else if (dir == 'downLeft') {
|
||||
viewPosition.x -= gridSize;
|
||||
viewPosition.y += gridSize;
|
||||
}
|
||||
else if (dir == 'center') {
|
||||
viewPosition.x = (canvas.dimensions.sceneWidth+window.innerWidth)/2;
|
||||
viewPosition.y = (canvas.dimensions.sceneHeight+window.innerHeight)/2;
|
||||
}
|
||||
canvas.animatePan(viewPosition);
|
||||
}
|
||||
}
|
||||
186
src/playlist.js
@@ -1,5 +1,6 @@
|
||||
import * as MODULE from "../MaterialDeck.js";
|
||||
import {streamDeck} from "../MaterialDeck.js";
|
||||
import {compatibleCore} from "./misc.js";
|
||||
|
||||
export class PlaylistControl{
|
||||
constructor(){
|
||||
@@ -10,47 +11,49 @@ export class PlaylistControl{
|
||||
|
||||
async updateAll(){
|
||||
if (this.active == false) return;
|
||||
for (let i=0; i<32; i++){
|
||||
let data = streamDeck.buttonContext[i];
|
||||
if (data == undefined || data.action != 'playlist') continue;
|
||||
await this.update(data.settings,data.context);
|
||||
for (let device of streamDeck.buttonContext) {
|
||||
if (device?.buttons == undefined) continue;
|
||||
for (let i=0; i<device.buttons.length; i++){
|
||||
const data = device.buttons[i];
|
||||
if (data == undefined || data.action != 'playlist') continue;
|
||||
await this.update(data.settings,data.context,device.device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(settings,context){
|
||||
this.active = true;
|
||||
if (settings.playlistMode == undefined) settings.playlistMode = 'playlist';
|
||||
if (settings.playlistMode == 'playlist'){
|
||||
this.updatePlaylist(settings,context);
|
||||
update(settings,context,device){
|
||||
if (MODULE.getPermission('PLAYLIST','PLAY') == false ) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
else if (settings.playlistMode == 'track'){
|
||||
this.updateTrack(settings,context);
|
||||
this.active = true;
|
||||
const mode = settings.playlistMode ? settings.playlistMode : 'playlist';
|
||||
|
||||
if (mode == 'playlist'){
|
||||
this.updatePlaylist(settings,context,device);
|
||||
}
|
||||
else if (mode == 'track'){
|
||||
this.updateTrack(settings,context,device);
|
||||
}
|
||||
else {
|
||||
let src = 'modules/MaterialDeck/img/playlist/stop.png';
|
||||
if (game.playlists.playing.length > 0)
|
||||
streamDeck.setIcon(context,src,settings.background,2,'#00FF00',true);
|
||||
else
|
||||
streamDeck.setIcon(context,src,settings.background,1,'#000000',true);
|
||||
const src = 'modules/MaterialDeck/img/playlist/stop.png';
|
||||
const background = settings.background ? settings.background : '#000000';
|
||||
const ringColor = (game.playlists.playing.length > 0) ? '#00FF00' : '#000000';
|
||||
const ring = (game.playlists.playing.length > 0) ? 2 : 1;
|
||||
const txt = settings.displayPlaylistName ? this.getPlaylist(this.playlistOffset).name : '';
|
||||
streamDeck.setIcon(context,device,src,{background:background,ring:ring,ringColor:ringColor,overlay:true});
|
||||
streamDeck.setTitle(txt,context);
|
||||
}
|
||||
}
|
||||
|
||||
updatePlaylist(settings,context){
|
||||
updatePlaylist(settings,context,device){
|
||||
let name = "";
|
||||
|
||||
let background = settings.background;
|
||||
if(background == undefined) background = '#000000';
|
||||
|
||||
let ringColor = "#000000"
|
||||
|
||||
let ringOffColor = settings.offRing;
|
||||
if (ringOffColor == undefined) ringOffColor = '#FF0000';
|
||||
|
||||
let ringOnColor = settings.onRing;
|
||||
if (ringOnColor == undefined) ringOnColor = '#00FF00';
|
||||
|
||||
let playlistType = settings.playlistType;
|
||||
if (playlistType == undefined) playlistType = 'playStop';
|
||||
const background = settings.background ? settings.background : '#000000';
|
||||
const ringOffColor = settings.offRing ? settings.offRing : '#FF0000';
|
||||
const ringOnColor = settings.onRing ? settings.onRing : '#00FF00';
|
||||
const playlistType = settings.playlistType ? settings.playlistType : 'playStop';
|
||||
let src = "modules/MaterialDeck/img/transparant.png";
|
||||
|
||||
//Play/Stop
|
||||
if (playlistType == 'playStop'){
|
||||
@@ -60,6 +63,7 @@ export class PlaylistControl{
|
||||
playlistNr += this.playlistOffset;
|
||||
|
||||
let playlist = this.getPlaylist(playlistNr);
|
||||
|
||||
if (playlist != undefined){
|
||||
if (playlist.playing)
|
||||
ringColor = ringOnColor;
|
||||
@@ -73,28 +77,31 @@ export class PlaylistControl{
|
||||
else if (playlistType == 'offset') {
|
||||
let playlistOffset = parseInt(settings.offset);
|
||||
if (isNaN(playlistOffset)) playlistOffset = 0;
|
||||
if (playlistOffset == this.playlistOffset) ringColor = ringOnColor;
|
||||
ringColor = (playlistOffset == this.playlistOffset) ? ringOnColor : ringOffColor;
|
||||
}
|
||||
streamDeck.setIcon(context,"",background,2,ringColor);
|
||||
//Relative Offset
|
||||
else if (playlistType == 'relativeOffset') {
|
||||
let playlistOffset = parseInt(settings.offset);
|
||||
if (isNaN(playlistOffset)) playlistOffset = 0;
|
||||
let number = parseInt(this.playlistOffset + playlistOffset);
|
||||
const nrOfPlaylists = parseInt(game.settings.get(MODULE.moduleName,'playlists').playlistNumber);
|
||||
if (number < 0) number += nrOfPlaylists;
|
||||
else if (number >= nrOfPlaylists) number -= nrOfPlaylists;
|
||||
const targetPlaylist = this.getPlaylist(number);
|
||||
if (targetPlaylist != undefined) name = targetPlaylist.name;
|
||||
}
|
||||
streamDeck.setIcon(context,device,src,{background:background,ring:2,ringColor:ringColor});
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
|
||||
updateTrack(settings,context){
|
||||
updateTrack(settings,context,device){
|
||||
let name = "";
|
||||
|
||||
let background = settings.background;
|
||||
if(background == undefined) background = '#000000';
|
||||
|
||||
let ringColor = "#000000"
|
||||
|
||||
let ringOffColor = settings.offRing;
|
||||
if (ringOffColor == undefined) ringOffColor = '#FF0000';
|
||||
|
||||
let ringOnColor = settings.onRing;
|
||||
if (ringOnColor == undefined) ringOnColor = '#00FF00';
|
||||
|
||||
let playlistType = settings.playlistType;
|
||||
if (playlistType == undefined) playlistType = 'playStop';
|
||||
const background = settings.background ? settings.background : '#000000';
|
||||
const ringOffColor = settings.offRing ? settings.offRing : '#FF0000';
|
||||
const ringOnColor = settings.onRing ? settings.onRing : '#00FF00';
|
||||
const playlistType = settings.playlistType ? settings.playlistType : 'playStop';
|
||||
let src = "modules/MaterialDeck/img/transparant.png";
|
||||
|
||||
//Play/Stop
|
||||
if (playlistType == 'playStop'){
|
||||
@@ -106,10 +113,10 @@ export class PlaylistControl{
|
||||
if (isNaN(trackNr) || trackNr < 1) trackNr = 1;
|
||||
trackNr--;
|
||||
trackNr += this.trackOffset;
|
||||
|
||||
|
||||
let playlist = this.getPlaylist(playlistNr);
|
||||
if (playlist != undefined){
|
||||
let track = playlist.data.sounds[trackNr];
|
||||
const track = compatibleCore("0.8.1") ? playlist.sounds.contents[trackNr] : playlist.sounds[trackNr];
|
||||
if (track != undefined){
|
||||
if (track.playing)
|
||||
ringColor = ringOnColor;
|
||||
@@ -121,16 +128,27 @@ export class PlaylistControl{
|
||||
}
|
||||
}
|
||||
//Offset
|
||||
else {
|
||||
else if (playlistType == 'offset') {
|
||||
let trackOffset = parseInt(settings.offset);
|
||||
if (isNaN(trackOffset)) trackOffset = 0;
|
||||
if (trackOffset == this.trackOffset) ringColor = ringOnColor;
|
||||
ringColor = (trackOffset == this.trackOffset) ? ringOnColor : ringOffColor;
|
||||
}
|
||||
streamDeck.setIcon(context,"",background,2,ringColor);
|
||||
//Relative Offset
|
||||
else if (playlistType == 'relativeOffset') {
|
||||
}
|
||||
streamDeck.setIcon(context,device,src,{background:background,ring:2,ringColor:ringColor});
|
||||
streamDeck.setTitle(name,context);
|
||||
}
|
||||
|
||||
stopAll(force=false){
|
||||
if (game.user.isGM == false) {
|
||||
const payload = {
|
||||
"msgType": "stopAllPlaylists",
|
||||
"force": force
|
||||
};
|
||||
game.socket.emit(`module.MaterialDeck`, payload);
|
||||
return;
|
||||
}
|
||||
if (force){
|
||||
let playing = game.playlists.playing;
|
||||
for (let i=0; i<playing.length; i++){
|
||||
@@ -152,11 +170,12 @@ export class PlaylistControl{
|
||||
getPlaylist(num){
|
||||
let selectedPlaylists = game.settings.get(MODULE.moduleName,'playlists').selectedPlaylist;
|
||||
if (selectedPlaylists != undefined)
|
||||
return game.playlists.entities.find(p => p._id == selectedPlaylists[num]);
|
||||
return game.playlists.get(selectedPlaylists[num]);
|
||||
else return undefined;
|
||||
}
|
||||
|
||||
keyPress(settings,context){
|
||||
keyPress(settings,context,device){
|
||||
if (MODULE.getPermission('PLAYLIST','PLAY') == false ) return;
|
||||
let playlistNr = settings.playlistNr;
|
||||
if (playlistNr == undefined || playlistNr < 1) playlistNr = 1;
|
||||
playlistNr--;
|
||||
@@ -166,41 +185,68 @@ export class PlaylistControl{
|
||||
trackNr--;
|
||||
trackNr += this.trackOffset;
|
||||
|
||||
if (settings.playlistMode == undefined) settings.playlistMode = 'playlist';
|
||||
if (settings.playlistType == undefined) settings.playlistType = 'playStop';
|
||||
if (settings.playlistMode == 'stopAll') {
|
||||
const playlistMode = settings.playlistMode ? settings.playlistMode : 'playlist';
|
||||
const playlistType = settings.playlistType ? settings.playlistType : 'playStop';
|
||||
|
||||
if (playlistMode == 'stopAll') {
|
||||
this.stopAll(true);
|
||||
}
|
||||
else {
|
||||
if (settings.playlistType == 'playStop') {
|
||||
if (playlistType == 'playStop') {
|
||||
let playlist = this.getPlaylist(playlistNr);
|
||||
if (playlist != undefined){
|
||||
if (settings.playlistMode == 'playlist')
|
||||
if (playlistMode == 'playlist')
|
||||
this.playPlaylist(playlist,playlistNr);
|
||||
else {
|
||||
let track = playlist.data.sounds[trackNr];
|
||||
const track = compatibleCore("0.8.1") ? playlist.sounds.contents[trackNr] : playlist.sounds[trackNr];
|
||||
if (track != undefined){
|
||||
this.playTrack(track,playlist,playlistNr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (settings.playlistMode == 'playlist') {
|
||||
else if (playlistType == 'offset'){
|
||||
if (playlistMode == 'playlist') {
|
||||
this.playlistOffset = parseInt(settings.offset);
|
||||
if (isNaN(this.playlistOffset)) this.playlistOffset = 0;
|
||||
}
|
||||
else {
|
||||
else {
|
||||
this.trackOffset = parseInt(settings.offset);
|
||||
if (isNaN(this.trackOffset)) this.trackOffset = 0;
|
||||
}
|
||||
this.updateAll();
|
||||
}
|
||||
else if (playlistType == 'relativeOffset'){
|
||||
if (playlistMode == 'playlist') {
|
||||
let playlistOffset = parseInt(settings.offset);
|
||||
if (isNaN(playlistOffset)) playlistOffset = 0;
|
||||
let number = parseInt(this.playlistOffset + playlistOffset);
|
||||
const nrOfPlaylists = parseInt(game.settings.get(MODULE.moduleName,'playlists').playlistNumber);
|
||||
if (number < 0) number += nrOfPlaylists;
|
||||
else if (number >= nrOfPlaylists) number -= nrOfPlaylists;
|
||||
this.playlistOffset = number;
|
||||
}
|
||||
else {
|
||||
let value = parseInt(settings.offset);
|
||||
if (isNaN(value)) return;
|
||||
this.trackOffset += value;
|
||||
}
|
||||
this.updateAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async playPlaylist(playlist,playlistNr){
|
||||
if (game.user.isGM == false) {
|
||||
const payload = {
|
||||
"msgType": "playPlaylist",
|
||||
"playlistId": playlist.id,
|
||||
"playlistNr": playlistNr
|
||||
};
|
||||
game.socket.emit(`module.MaterialDeck`, payload);
|
||||
return;
|
||||
}
|
||||
if (playlist.playing) {
|
||||
playlist.stopAll();
|
||||
return;
|
||||
@@ -214,6 +260,16 @@ export class PlaylistControl{
|
||||
}
|
||||
|
||||
async playTrack(track,playlist,playlistNr){
|
||||
if (game.user.isGM == false) {
|
||||
const payload = {
|
||||
"msgType": "playTrack",
|
||||
"playlistId": playlist.id,
|
||||
"playlistNr": playlistNr,
|
||||
"trackId": track._id
|
||||
};
|
||||
game.socket.emit(`module.MaterialDeck`, payload);
|
||||
return;
|
||||
}
|
||||
let play;
|
||||
if (track.playing)
|
||||
play = false;
|
||||
@@ -227,7 +283,11 @@ export class PlaylistControl{
|
||||
}
|
||||
else if (mode == 2) await playlist.stopAll();
|
||||
}
|
||||
await playlist.updateEmbeddedEntity("PlaylistSound", {_id: track._id, playing: play});
|
||||
|
||||
if (compatibleCore("0.8.1") && play) await playlist.playSound(track);
|
||||
else if (compatibleCore("0.8.1")) await playlist.stopSound(track);
|
||||
else await playlist.updateEmbeddedEntity("PlaylistSound", {_id: track._id, playing: play});
|
||||
|
||||
playlist.update({playing: play});
|
||||
}
|
||||
}
|
||||
214
src/scene.js
Normal file
@@ -0,0 +1,214 @@
|
||||
import * as MODULE from "../MaterialDeck.js";
|
||||
import {streamDeck} from "../MaterialDeck.js";
|
||||
import {compatibleCore} from "./misc.js";
|
||||
|
||||
export class SceneControl{
|
||||
constructor(){
|
||||
this.active = false;
|
||||
this.rollData = {};
|
||||
this.sceneOffset = 0;
|
||||
}
|
||||
|
||||
async updateAll(){
|
||||
if (this.active == false) return;
|
||||
for (let device of streamDeck.buttonContext) {
|
||||
if (device?.buttons == undefined) continue;
|
||||
for (let i=0; i<device.buttons.length; i++){
|
||||
const data = device.buttons[i];
|
||||
if (data == undefined || data.action != 'scene') continue;
|
||||
await this.update(data.settings,data.context,device.device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(settings,context,device){
|
||||
if (canvas.scene == null) return;
|
||||
this.active = true;
|
||||
const func = settings.sceneFunction ? settings.sceneFunction : 'visible';
|
||||
const background = settings.background ? settings.background : '#000000';
|
||||
const ringOffColor = settings.offRing ? settings.offRing : '#000000';
|
||||
const ringOnColor = settings.onRing ? settings.onRing : '#00FF00';
|
||||
let ringColor = "#000000";
|
||||
let ring = 2;
|
||||
|
||||
let src = "";
|
||||
let name = "";
|
||||
if (func == 'visible') { //visible scenes
|
||||
if (MODULE.getPermission('SCENE','VISIBLE') == false ) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
let nr = parseInt(settings.sceneNr);
|
||||
if (isNaN(nr) || nr < 1) nr = 1;
|
||||
nr--;
|
||||
|
||||
let scene = game.scenes.apps[0].scenes[nr];
|
||||
|
||||
if (scene != undefined){
|
||||
ringColor = scene.isView ? ringOnColor : ringOffColor;
|
||||
if (settings.displaySceneName) name = scene.name;
|
||||
if (settings.displaySceneIcon) src = scene.img;
|
||||
if (scene.active) name += "\n(Active)";
|
||||
}
|
||||
}
|
||||
else if (func == 'dir') { //from directory
|
||||
if (MODULE.getPermission('SCENE','DIRECTORY') == false ) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
let nr = parseInt(settings.sceneNr);
|
||||
if (isNaN(nr) || nr < 1) nr = 1;
|
||||
nr--;
|
||||
|
||||
let sceneList = [];
|
||||
for (let i=0; i<ui.scenes.tree.children.length; i++){
|
||||
const scenesInFolder = compatibleCore("0.8.1") ? ui.scenes.tree.children[i].contents : ui.scenes.tree.children[i].entities;
|
||||
for (let j=0; j<scenesInFolder.length; j++)
|
||||
sceneList.push(scenesInFolder[j])
|
||||
}
|
||||
for (let i=0; i<ui.scenes.tree.content.length; i++)
|
||||
sceneList.push(ui.scenes.tree.content[i])
|
||||
|
||||
const scene = sceneList[nr+this.sceneOffset];
|
||||
|
||||
if (scene != undefined){
|
||||
if (scene.isView)
|
||||
ringColor = ringOnColor;
|
||||
else if (scene.data.navigation && scene.data.permission.default == 0)
|
||||
ringColor = '#000791';
|
||||
else if (scene.data.navigation)
|
||||
ringColor = '#2d2d2d';
|
||||
else
|
||||
ringColor = ringOffColor;
|
||||
|
||||
if (settings.displaySceneName) name = scene.name;
|
||||
if (settings.displaySceneIcon) src = scene.img;
|
||||
if (scene.active) name += "\n(Active)";
|
||||
}
|
||||
}
|
||||
else if (func == 'any') { //by name
|
||||
if (MODULE.getPermission('SCENE','NAME') == false ) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
if (settings.sceneName == undefined || settings.sceneName == '') return;
|
||||
let scene = game.scenes.getName(settings.sceneName);
|
||||
|
||||
if (scene != undefined){
|
||||
ringColor = scene.isView ? ringOnColor : ringOffColor;
|
||||
if (settings.displaySceneName) name = scene.name;
|
||||
if (settings.displaySceneIcon) src = scene.img;
|
||||
if (scene.active) name += "\n(Active)";
|
||||
}
|
||||
}
|
||||
else if (func == 'active'){
|
||||
if (MODULE.getPermission('SCENE','ACTIVE') == false ) {
|
||||
streamDeck.noPermission(context,device);
|
||||
return;
|
||||
}
|
||||
const scene = game.scenes.active;
|
||||
if (scene == undefined) return;
|
||||
if (settings.displaySceneName) name = scene.name;
|
||||
if (settings.displaySceneIcon) src = scene.img;
|
||||
ring = 0;
|
||||
}
|
||||
else if (func == 'offset'){
|
||||
let offset = parseInt(settings.sceneOffset);
|
||||
if (isNaN(offset)) offset = 0;
|
||||
ringColor = (offset == this.sceneOffset) ? ringOnColor : ringOffColor;
|
||||
src = "modules/MaterialDeck/img/transparant.png";
|
||||
}
|
||||
streamDeck.setTitle(name,context);
|
||||
streamDeck.setIcon(context,device,src,{background:background,ring:ring,ringColor:ringColor});
|
||||
}
|
||||
|
||||
keyPress(settings){
|
||||
const func = settings.sceneFunction ? settings.sceneFunction : 'visible';
|
||||
|
||||
if (func == 'visible'){ //visible scenes
|
||||
if (MODULE.getPermission('SCENE','VISIBLE') == false ) return;
|
||||
const viewFunc = settings.sceneViewFunction ? settings.sceneViewFunction : 'view';
|
||||
let nr = parseInt(settings.sceneNr);
|
||||
if (isNaN(nr) || nr < 1) nr = 1;
|
||||
nr--;
|
||||
let scene = game.scenes.apps[0].scenes[nr];
|
||||
|
||||
if (scene != undefined){
|
||||
if (viewFunc == 'view'){
|
||||
scene.view();
|
||||
}
|
||||
else if (viewFunc == 'activate'){
|
||||
scene.activate();
|
||||
}
|
||||
else {
|
||||
if (scene.isView) scene.activate();
|
||||
scene.view();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (func == 'dir') { //from directory
|
||||
if (MODULE.getPermission('SCENE','DIRECTORY') == false ) return;
|
||||
const viewFunc = settings.sceneViewFunction ? settings.sceneViewFunction : 'view';
|
||||
let nr = parseInt(settings.sceneNr);
|
||||
if (isNaN(nr) || nr < 1) nr = 1;
|
||||
nr--;
|
||||
|
||||
let sceneList = [];
|
||||
for (let i=0; i<ui.scenes.tree.children.length; i++){
|
||||
const scenesInFolder = compatibleCore("0.8.1") ? ui.scenes.tree.children[i].contents : ui.scenes.tree.children[i].entities;
|
||||
for (let j=0; j<scenesInFolder.length; j++)
|
||||
sceneList.push(scenesInFolder[j])
|
||||
}
|
||||
for (let i=0; i<ui.scenes.tree.content.length; i++)
|
||||
sceneList.push(ui.scenes.tree.content[i])
|
||||
|
||||
const scene = sceneList[nr+this.sceneOffset];
|
||||
|
||||
if (scene != undefined){
|
||||
if (viewFunc == 'view'){
|
||||
scene.view();
|
||||
}
|
||||
else if (viewFunc == 'activate'){
|
||||
scene.activate();
|
||||
}
|
||||
else {
|
||||
if (scene.isView) scene.activate();
|
||||
scene.view();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (func == 'any'){ //by name
|
||||
if (MODULE.getPermission('SCENE','NAME') == false ) return;
|
||||
if (settings.sceneName == undefined || settings.sceneName == '') return;
|
||||
const scenes = game.scenes.entries;
|
||||
let scene = game.scenes.getName(settings.sceneName);
|
||||
if (scene == undefined) return;
|
||||
|
||||
const viewFunc = settings.sceneViewFunction ? settings.sceneViewFunction : 'view';
|
||||
|
||||
if (viewFunc == 'view'){
|
||||
scene.view();
|
||||
}
|
||||
else if (viewFunc == 'activate'){
|
||||
scene.activate();
|
||||
}
|
||||
else {
|
||||
if (scene.isView) scene.activate();
|
||||
scene.view();
|
||||
}
|
||||
}
|
||||
else if (func == 'active'){
|
||||
if (MODULE.getPermission('SCENE','ACTIVE') == false ) return;
|
||||
const scene = game.scenes.active;
|
||||
if (scene == undefined) return;
|
||||
scene.view();
|
||||
}
|
||||
else if (func == 'offset'){
|
||||
let offset = parseInt(settings.sceneOffset);
|
||||
if (isNaN(offset)) offset = 0;
|
||||
this.sceneOffset = offset;
|
||||
this.updateAll();
|
||||
}
|
||||
}
|
||||
}
|
||||