feat: display live boolean values on BinaryIndexDecoder outputs

Returns ui values alongside result so JS onExecuted can update the
output slot labels with the actual true/false values after execution,
matching the KJNodes style inline display.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 13:18:06 +02:00
parent 3b700b099b
commit 5d2f3bbf4f
2 changed files with 22 additions and 5 deletions
+17
View File
@@ -0,0 +1,17 @@
import { app } from "../../scripts/app.js";
app.registerExtension({
name: "json.manager.binary_index_decoder",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
if (nodeData.name !== "BinaryIndexDecoder") return;
nodeType.prototype.onExecuted = function (output) {
if (!output?.values) return;
for (let i = 0; i < Math.min(output.values.length, this.outputs.length); i++) {
this.outputs[i].label = `${this.outputs[i].name} ${output.values[i]}`;
}
app.graph?.setDirtyCanvas(true, true);
};
},
});