mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
fixes
This commit is contained in:
@@ -3192,6 +3192,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if(slot == null)
|
||||
{
|
||||
console.error("slot must be a number");
|
||||
return;
|
||||
}
|
||||
|
||||
if(slot.constructor !== Number)
|
||||
console.warn("slot must be a number, use node.trigger('name') if you want to use a string");
|
||||
|
||||
var output = this.outputs[slot];
|
||||
if (!output) {
|
||||
return;
|
||||
|
||||
@@ -437,7 +437,32 @@
|
||||
|
||||
LiteGraph.registerNodeType("events/semaphore", SemaphoreEvent);
|
||||
|
||||
function OnceEvent() {
|
||||
this.addInput("in", LiteGraph.ACTION );
|
||||
this.addInput("reset", LiteGraph.ACTION );
|
||||
this.addOutput("out", LiteGraph.EVENT );
|
||||
this._once = false;
|
||||
this.properties = {};
|
||||
var that = this;
|
||||
this.addWidget("button","reset","",function(){
|
||||
that._once = false;
|
||||
});
|
||||
}
|
||||
|
||||
OnceEvent.title = "Once";
|
||||
OnceEvent.desc = "Only passes an event once, then gets locked";
|
||||
|
||||
OnceEvent.prototype.onAction = function(action, param) {
|
||||
if( action == "in" && !this._once )
|
||||
{
|
||||
this._once = true;
|
||||
this.triggerSlot( 0, param );
|
||||
}
|
||||
else if( action == "reset" )
|
||||
this._once = false;
|
||||
};
|
||||
|
||||
LiteGraph.registerNodeType("events/once", OnceEvent);
|
||||
|
||||
function DataStore() {
|
||||
this.addInput("data", 0);
|
||||
|
||||
Reference in New Issue
Block a user