Skip to content

Commit

Permalink
Add ccx file location button to preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
danim1130 committed Sep 11, 2024
1 parent 3db6a71 commit 3a932e7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
13 changes: 12 additions & 1 deletion components/src/Preferences.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@
<div class="flex flex-row content-center">Photoshop Preference <div style="margin-left: 12px; width: 12px; height: 12px; border-radius: 50%; background-color: {currentlyConnected ? "#00D248" : "#fb2323"}" /></div>
</BlockTitle>
<BlockBody>
Connection status: {currentlyConnected ? "Connected" : "Connecting"}
Connection to localhost:3542 : {currentlyConnected ? "Connected" : "Connecting"}
</BlockBody>
<BlockBody>
Photoshop plugin must be installed!
<MoltenButton
title={"CCX file location"}
click={() => {
messagePort.postMessage({
type: "open-plugin-folder",
});
}}
/>
</BlockBody>
</Block>
</div>
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
let fs = require("fs");
let path = require("path");
const WebSocket = require("ws");
const openExplorer = require("open-file-explorer");

let wss = undefined;
let photoshopWs = undefined;
Expand Down Expand Up @@ -118,6 +119,13 @@ exports.addMessagePort = async function (port) {
port.on("close", () => {
preferenceMessagePort = undefined;
});
port.on("message", (e) => {
console.log({ e });
if (e.data.type === "open-plugin-folder") {
openExplorer(__dirname);
}
});
port.start();
notifyStatusChange();
};

Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"preferenceComponent": "photoshop-preference"
},
"dependencies": {
"ws": "^8.18.0"
"ws": "^8.18.0",
"open-file-explorer": "^1.0.2"
}
}

0 comments on commit 3a932e7

Please sign in to comment.