From 19da7ad15d4d0d5aba3eea482ad427a7ad4d9955 Mon Sep 17 00:00:00 2001 From: 80sVectorz <66908776+80sVectorz@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:06:12 +0100 Subject: [PATCH] Solved COMBO type ugly display issue --- js/static_primitives.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/js/static_primitives.js b/js/static_primitives.js index e9004f3..4b45a09 100644 --- a/js/static_primitives.js +++ b/js/static_primitives.js @@ -2,7 +2,7 @@ import { app } from "../../../scripts/app.js"; import { addValueControlWidget } from "../../../scripts/widgets.js"; app.registerExtension({ - name: "StaticPrimitives", + name: "StaticPrimitives.NumericPrimitives.control_after_generate", async nodeCreated(node) { const staticPrimitiveWidgetIndex = node.widgets?.findIndex((w) => w.name === 'Input_FLOAT' || w.name == 'Input_INT'); if (staticPrimitiveWidgetIndex > -1) { @@ -11,4 +11,20 @@ app.registerExtension({ node.widgets.splice(staticPrimitiveWidgetIndex+1,0,node.widgets.pop()); } } +}); +app.registerExtension({ + name: "StaticPrimitives.CollectionPrimitives.OutputLabels", + async beforeRegisterNodeDef(nodeType, nodeData, app){ + if (nodeData.name.endsWith("StaticCollectionPrimitive")){ + const originalNodeCreated = nodeType.prototype.onNodeCreated; + nodeType.prototype.onNodeCreated = function () { + originalNodeCreated?.apply(this,arguments); + var name = this.type; + name = name.slice(0,name.length-"StaticCollectionPrimitive".length); + this.addOutput(name,"COMBO"); + this.removeOutput(0); + originalNodeCreated?.apply(this,arguments); + } + } + } }); \ No newline at end of file