Files
kk8bit-KayTool/web/kaynodes.js
T
2025-02-24 04:11:39 +08:00

18 lines
742 B
JavaScript

import { app } from "../../../scripts/app.js";
app.registerExtension({
name: "KayTool.KayNodes",
async setup() {
console.log("[KayTool] Enhancing virtual connections");
const originalComputeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
LGraphCanvas.prototype.computeVisibleNodes = function () {
const visibleNodesSet = new Set(originalComputeVisibleNodes.apply(this, arguments));
for (const node of this.graph._nodes) {
if ((node.type === "KaySetNode" || node.type === "KayGetNode") && node.drawConnection) {
visibleNodesSet.add(node);
}
}
return Array.from(visibleNodesSet);
};
}
});