diff --git a/Plugin/Release/com.cdeenen.materialdeck.streamDeckPlugin b/Plugin/Release/com.cdeenen.materialdeck.streamDeckPlugin index c8eddae..d3b0f9d 100644 Binary files a/Plugin/Release/com.cdeenen.materialdeck.streamDeckPlugin and b/Plugin/Release/com.cdeenen.materialdeck.streamDeckPlugin differ diff --git a/Plugin/com.cdeenen.materialdeck.sdPlugin/app.js b/Plugin/com.cdeenen.materialdeck.sdPlugin/app.js index 59a25e6..56e7164 100644 --- a/Plugin/com.cdeenen.materialdeck.sdPlugin/app.js +++ b/Plugin/com.cdeenen.materialdeck.sdPlugin/app.js @@ -41,6 +41,9 @@ function connected(jsn) { $SD.on(actions[i]+'.keyDown', (jsonObj) => action.onEvent(jsonObj)); $SD.on(actions[i]+'.keyUp', (jsonObj) => action.onEvent(jsonObj)); $SD.on(actions[i]+'.didReceiveSettings', (jsonObj) => action.onEvent(jsonObj)); + //$SD.on(actions[i]+'.propertyInspectorDidAppear', (jsonObj) => { + // console.log('%c%s', 'color: white; background: black; font-size: 13px;', '[app.js]propertyInspectorDidAppear:'); + // }); } }; @@ -240,8 +243,7 @@ function sendToSDWS(msg) { //setState(msg); } else if (event == 'setIcon'){ - let msg = {context: context, url: data.url, format: data.format, background: data.background, combat: data.combat} - drawImage(msg); + drawImage(data); } else $SD.connection.send(msg); @@ -333,7 +335,6 @@ function drawImage(data){ console.log('drawImage1',data); if (data == undefined) return; - const context = data.context; var url = data.url; const format = data.format; @@ -347,13 +348,9 @@ function drawImage(data){ BGvalid = false; if (BGvalid == false) background = '#000000'; - //console.log('drawImage',{context:context,url:url,format:format,background:background}) - if (format == 'svg'){ - url = "action/images/black.png"; - } if (url == "" || format == 'color') url = "action/images/transparant.png" - console.log(url); + let canvas; let canvasId = 'canvas' + counter; canvas = document.getElementById(canvasId); @@ -364,17 +361,21 @@ function drawImage(data){ ctx.filter = "none"; let margin = 0; - ctx.fillStyle = background; - ctx.fillRect(0, 0, canvas.width, canvas.height); - if (data.combat != undefined && data.combat > 0){ + if (data.ring != undefined && data.ring > 0){ + ctx.fillStyle = background; + ctx.fillRect(0, 0, canvas.width, canvas.height); margin = 10; - if (data.combat == 2) { - ctx.fillStyle = '#cccc00'; + if (data.ring == 2) { + ctx.fillStyle = data.ringColor; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = background; ctx.fillRect(margin, margin, canvas.width-2*margin, canvas.height-2*margin); } } + else { + ctx.fillStyle = background; + ctx.fillRect(0, 0, canvas.width, canvas.height); + } let resImageURL = url; @@ -412,9 +413,6 @@ function drawImage(data){ yStart = 0; } - if (data.combat){ - - } ctx.drawImage(img, xStart+margin, yStart+margin, renderableWidth - 2*margin, renderableHeight - 2*margin); var json = { diff --git a/Plugin/com.cdeenen.materialdeck.sdPlugin/de.json b/Plugin/com.cdeenen.materialdeck.sdPlugin/de.json deleted file mode 100644 index 9b5d28c..0000000 --- a/Plugin/com.cdeenen.materialdeck.sdPlugin/de.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "Nimm diese Vorlage für dein erstes Plugin", - "Name": "Stream Deck Template", - "Category": "Templates", - "com.elgato.template.action": { - "Name": "Action", - "Tooltip": "Dies ist die einzige 'Action' in diesem Template" - }, - "Localization": { - "More info": "Mehr Infos", - "Message": "Nachricht", - "Click Me": "Klicke mich", - "Button": "Taste" - - } -} diff --git a/Plugin/com.cdeenen.materialdeck.sdPlugin/en.json b/Plugin/com.cdeenen.materialdeck.sdPlugin/en.json deleted file mode 100644 index 09fdcd4..0000000 --- a/Plugin/com.cdeenen.materialdeck.sdPlugin/en.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "Use this to create your own plugin", - "Name": "Stream Deck Template", - "Category": "Templates", - "com.elgato.template.action": { - "Name": "Action", - "Tooltip": "This is the only action in this plugin" - }, - "Localization": { - "More info": "More info", - "Message": "Message", - "Click Me": "Click Me", - "Button": "Button" - } -} diff --git a/Plugin/com.cdeenen.materialdeck.sdPlugin/externalWindow.html b/Plugin/com.cdeenen.materialdeck.sdPlugin/externalWindow.html index c3b88da..12460ad 100644 --- a/Plugin/com.cdeenen.materialdeck.sdPlugin/externalWindow.html +++ b/Plugin/com.cdeenen.materialdeck.sdPlugin/externalWindow.html @@ -2,7 +2,7 @@ - com.elgato.template.externalWindow + com.cdeenen.materialplane.externalWindow