text: // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
  
  
  #include "GraphEditorCommon.h"
  #include "SGraphPinExec.h"
  
  void SGraphPinExec::Construct(const FArguments& InArgs, UEdGraphPin* InPin)
  {
  	SGraphPin::Construct(SGraphPin::FArguments(), InPin);
  
  	bWasEventPin = false;
  	CachePinBrushes(/*bForceCache=*/ true);
  }
  
  TSharedRef<SWidget>	SGraphPinExec::GetDefaultValueWidget()
  {
  	return SNew(SSpacer); // not used for exec pin		
  }
  
  const FSlateBrush* SGraphPinExec::GetPinIcon() const
  {
  	CachePinBrushes();
  
  	const FSlateBrush* Brush = NULL;
  
  	if (IsConnected())
  	{
  		Brush = IsHovered() ? CachedImg_Pin_ConnectedHovered : CachedImg_Pin_Connected;
  	}
  	else
  	{
  		Brush = IsHovered() ? CachedImg_Pin_DisconnectedHovered : CachedImg_Pin_Disconnected;
  	}
  
  	return Brush;
  }
  
  void SGraphPinExec::CachePinBrushes(bool bForceCache) const
  {
  	if (bForceCache)
  	{
  		CachedImg_Pin_ConnectedHovered = FEditorStyle::GetBrush(TEXT("Graph.ExecPin.ConnectedHovered"));
  		CachedImg_Pin_Connected = FEditorStyle::GetBrush(TEXT("Graph.ExecPin.Connected"));
  		CachedImg_Pin_DisconnectedHovered = FEditorStyle::GetBrush(TEXT("Graph.ExecPin.DisconnectedHovered"));
  		CachedImg_Pin_Disconnected = FEditorStyle::GetBrush(TEXT("Graph.ExecPin.Disconnected"));
  	}
  }