Solved COMBO type ugly display issue
This commit is contained in:
+17
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user