Chenges to allow ability to automatically create inputs if required.

This commit is contained in:
ilya
2020-07-08 21:14:36 +03:00
parent 6ac6948609
commit 0238a5dcae
2 changed files with 37 additions and 21 deletions

11
src/litegraph.d.ts vendored
View File

@@ -938,6 +938,17 @@ export declare class LGraphNode {
_this: this,
slotIndex: number
): boolean;
/**
* Called just before connection (or disconnect - if input is linked).
* A convenient place to switch to another input, or create new one.
* This allow for ability to automatically add slots if needed
* @param inputIndex
* @return selected input slot index, can differ from parameter value
*/
onBeforeConnectInput?(
inputIndex: number
): number;
/** a connection changed (new one or removed) (LiteGraph.INPUT or LiteGraph.OUTPUT, slot, true if connected, link_info, input_info or output_info ) */
onConnectionsChange(