浏览代码

moved connected check to different function in order to not break ff tests

Kyle Belfort 5 年之前
父节点
当前提交
5608004b3d

+ 2 - 2
nodeEditor/src/diagram/nodePort.ts

@@ -19,7 +19,7 @@ export class NodePort {
     protected _portLabelElement: Element;
     protected _onCandidateLinkMovedObserver: Nullable<Observer<Nullable<Vector2>>>;
     protected _onSelectionChangedObserver: Nullable<Observer<Nullable<GraphFrame | GraphNode | NodeLink | NodePort | FramePortData>>>;
-    protected _exposedOnFrame = this.connectionPoint.isConnected || false;
+    protected _exposedOnFrame = this.connectionPoint.isConnectedToAnything || false;
     
     public delegatedPort: Nullable<FrameNodePort> = null;
 
@@ -51,7 +51,7 @@ export class NodePort {
     }
 
     public get exposedOnFrame() {
-        return this._exposedOnFrame || this.connectionPoint.isConnected;
+        return this._exposedOnFrame || this.connectionPoint.isConnectedToAnything;
     }
 
     public set exposedOnFrame(value: boolean) {

+ 1 - 1
nodeEditor/src/diagram/properties/nodePortPropertyComponent.tsx

@@ -40,7 +40,7 @@ export class NodePortPropertyTabComponent extends React.Component<IFrameNodePort
                 <div>
                     <LineContainerComponent title="GENERAL">
                         {this.props.nodePort.hasLabel() && <TextInputLineComponent globalState={this.props.globalState} label="Port Label" propertyName="portName" target={this.props.nodePort} />}
-                        {this.props.nodePort.node.isEnclosedInAFrame && <CheckBoxLineComponent label= "Expose Port on Frame" target={this.props.nodePort} isSelected={() => this.props.nodePort.exposedOnFrame} onSelect={(value: boolean) => this.props.nodePort.exposedOnFrame = value}  propertyName="exposedOnFrame" disabled={this.props.nodePort.connectionPoint.isConnected} />}
+                        {this.props.nodePort.node.isEnclosedInAFrame && <CheckBoxLineComponent label= "Expose Port on Frame" target={this.props.nodePort} isSelected={() => this.props.nodePort.exposedOnFrame} onSelect={(value: boolean) => this.props.nodePort.exposedOnFrame = value}  propertyName="exposedOnFrame" disabled={this.props.nodePort.connectionPoint.isConnectedToAnything} />}
                     </LineContainerComponent>
                 </div>
             </div>

+ 9 - 1
src/Materials/Node/nodeMaterialBlockConnectionPoint.ts

@@ -175,10 +175,18 @@ export class NodeMaterialConnectionPoint {
     }
 
     /**
-     * Gets a boolean indicating that the current point is connected
+     * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock
      */
     public get isConnected(): boolean {
+        return this.connectedPoint !== null;
+    }
+
+    /**
+     * Gets a boolean indicating that the current point is connected to anything (another NodeMaterialBlock, a shader, or a Input Block, etc).
+     */
+    public get isConnectedToAnything() {
         return this.connectedPoint !== null || this.isConnectedInFragmentShader || this.isConnectedInVertexShader || this.isConnectedToInputBlock || this._endpoints.length > 0;
+
     }
 
     /**