From 318201cb4e54ece6a0027839753479593cce01ea Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:22:50 +1000 Subject: [PATCH] Add link colour fix - set link type on connection change --- js/debugnode.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/debugnode.js b/js/debugnode.js index a670776..f04a30b 100644 --- a/js/debugnode.js +++ b/js/debugnode.js @@ -23,6 +23,13 @@ app.registerExtension({ name: "WTFDebugNode", async beforeRegisterNodeDef(nodeType, nodeData, app) { if (nodeData.name === "WTFDebugNode") { + const origOnConnectionsChange = nodeType.prototype.onConnectionsChange + nodeType.prototype.onConnectionsChange = function (type, slotIndex, isConnected, link, ioSlot) { + origOnConnectionsChange?.apply(this, arguments) + + if (isConnected && link?.type === "*") + link.type = this.graph.getNodeById(link.origin_id)?.outputs?.[link.origin_slot]?.type + } const origOnExecuted = nodeType.prototype.onExecuted; nodeType.prototype.onExecuted = function (message) {