2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "EnvironmentQueryEditorPrivatePCH.h"
|
|
|
|
|
#include "SGraphPreviewer.h"
|
|
|
|
|
#include "Editor/UnrealEd/Public/Kismet2/BlueprintEditorUtils.h"
|
|
|
|
|
#include "NodeFactory.h"
|
|
|
|
|
#include "SGraphNode.h"
|
|
|
|
|
#include "SGraphNode_EnvironmentQuery.h"
|
|
|
|
|
#include "SGraphPin.h"
|
|
|
|
|
#include "SGraphPanel.h"
|
|
|
|
|
#include "ScopedTransaction.h"
|
|
|
|
|
#include "EnvironmentQueryColors.h"
|
2014-05-29 17:06:50 -04:00
|
|
|
#include "EnvironmentQuery/EnvQueryTest.h"
|
2014-10-14 22:50:06 -04:00
|
|
|
#include "SInlineEditableTextBlock.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "EnvironmentQueryEditor"
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
class SEnvironmentQueryPin : public SGraphPinAI
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SLATE_BEGIN_ARGS(SEnvironmentQueryPin){}
|
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
|
|
|
|
void Construct(const FArguments& InArgs, UEdGraphPin* InPin);
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
virtual FSlateColor GetPinColor() const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void SEnvironmentQueryPin::Construct(const FArguments& InArgs, UEdGraphPin* InPin)
|
|
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
SGraphPinAI::Construct(SGraphPinAI::FArguments(), InPin);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSlateColor SEnvironmentQueryPin::GetPinColor() const
|
|
|
|
|
{
|
|
|
|
|
return IsHovered() ? EnvironmentQueryColors::Pin::Hover :
|
|
|
|
|
EnvironmentQueryColors::Pin::Default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// SGraphNode_EnvironmentQuery
|
|
|
|
|
|
|
|
|
|
void SGraphNode_EnvironmentQuery::Construct(const FArguments& InArgs, UEnvironmentQueryGraphNode* InNode)
|
|
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
SGraphNodeAI::Construct(SGraphNodeAI::FArguments(), InNode);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
void SGraphNode_EnvironmentQuery::AddSubNode(TSharedPtr<SGraphNode> SubNodeWidget)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
SGraphNodeAI::AddSubNode(SubNodeWidget);
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
TestBox->AddSlot().AutoHeight()
|
|
|
|
|
[
|
2015-02-23 10:30:16 -05:00
|
|
|
SubNodeWidget.ToSharedRef()
|
2014-03-14 14:13:41 -04:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSlateColor SGraphNode_EnvironmentQuery::GetBorderBackgroundColor() const
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* TestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
2014-10-24 17:47:36 -04:00
|
|
|
const bool bSelectedSubNode = TestNode && TestNode->ParentNode && GetOwnerPanel().IsValid() && GetOwnerPanel()->SelectionManager.SelectedNodes.Contains(GraphNode);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
return bSelectedSubNode ? EnvironmentQueryColors::NodeBorder::Selected :
|
|
|
|
|
EnvironmentQueryColors::NodeBorder::Default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSlateColor SGraphNode_EnvironmentQuery::GetBackgroundColor() const
|
|
|
|
|
{
|
|
|
|
|
const UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(GraphNode);
|
|
|
|
|
const UClass* MyClass = MyNode && MyNode->NodeInstance ? MyNode->NodeInstance->GetClass() : NULL;
|
|
|
|
|
|
|
|
|
|
FLinearColor NodeColor = EnvironmentQueryColors::NodeBody::Default;
|
|
|
|
|
if (MyClass)
|
|
|
|
|
{
|
|
|
|
|
if (MyClass->IsChildOf( UEnvQueryTest::StaticClass() ))
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
|
|
|
|
NodeColor = (MyTestNode && MyTestNode->bTestEnabled) ? EnvironmentQueryColors::NodeBody::Test : EnvironmentQueryColors::NodeBody::TestInactive;
|
|
|
|
|
}
|
|
|
|
|
else if (MyClass->IsChildOf( UEnvQueryOption::StaticClass() ))
|
|
|
|
|
{
|
|
|
|
|
NodeColor = EnvironmentQueryColors::NodeBody::Generator;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NodeColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SGraphNode_EnvironmentQuery::UpdateGraphNode()
|
|
|
|
|
{
|
|
|
|
|
if (TestBox.IsValid())
|
|
|
|
|
{
|
|
|
|
|
TestBox->ClearChildren();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SAssignNew(TestBox,SVerticalBox);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputPins.Empty();
|
|
|
|
|
OutputPins.Empty();
|
|
|
|
|
|
|
|
|
|
// Reset variables that are going to be exposed, in case we are refreshing an already setup node.
|
|
|
|
|
RightNodeBox.Reset();
|
|
|
|
|
LeftNodeBox.Reset();
|
2015-02-23 10:30:16 -05:00
|
|
|
SubNodes.Reset();
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const float NodePadding = (Cast<UEnvironmentQueryGraphNode_Test>(GraphNode) != NULL) ? 2.0f : 10.0f;
|
|
|
|
|
float TestPadding = 0.0f;
|
|
|
|
|
|
|
|
|
|
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(GraphNode);
|
|
|
|
|
if (OptionNode)
|
|
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < OptionNode->SubNodes.Num(); Idx++)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
if (OptionNode->SubNodes[Idx])
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
TSharedPtr<SGraphNode> NewNode = FNodeFactory::CreateNodeWidget(OptionNode->SubNodes[Idx]);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (OwnerGraphPanelPtr.IsValid())
|
|
|
|
|
{
|
|
|
|
|
NewNode->SetOwner(OwnerGraphPanelPtr.Pin().ToSharedRef());
|
|
|
|
|
OwnerGraphPanelPtr.Pin()->AttachGraphEvents(NewNode);
|
|
|
|
|
}
|
2015-02-23 10:30:16 -05:00
|
|
|
AddSubNode(NewNode);
|
2014-03-14 14:13:41 -04:00
|
|
|
NewNode->UpdateGraphNode();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
if (SubNodes.Num() == 0)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
TestBox->AddSlot().AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
SNew(STextBlock).Text(LOCTEXT("NoTests","Right click to add tests"))
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TestPadding = 10.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FSlateBrush* NodeTypeIcon = GetNameIcon();
|
|
|
|
|
|
|
|
|
|
FLinearColor TitleShadowColor(1.0f, 0.0f, 0.0f);
|
|
|
|
|
TSharedPtr<SErrorText> ErrorText;
|
|
|
|
|
TSharedPtr<STextBlock> DescriptionText;
|
|
|
|
|
TSharedPtr<SNodeTitle> NodeTitle = SNew(SNodeTitle, GraphNode);
|
|
|
|
|
|
|
|
|
|
this->ContentScale.Bind( this, &SGraphNode::GetContentScale );
|
2014-11-03 10:40:57 -05:00
|
|
|
this->GetOrAddSlot( ENodeZone::Center )
|
2014-03-14 14:13:41 -04:00
|
|
|
.HAlign(HAlign_Fill)
|
|
|
|
|
.VAlign(VAlign_Center)
|
|
|
|
|
[
|
|
|
|
|
SNew(SBorder)
|
|
|
|
|
.BorderImage( FEditorStyle::GetBrush( "Graph.StateNode.Body" ) )
|
|
|
|
|
.Padding(0)
|
|
|
|
|
.BorderBackgroundColor( this, &SGraphNode_EnvironmentQuery::GetBorderBackgroundColor )
|
|
|
|
|
.OnMouseButtonDown(this, &SGraphNode_EnvironmentQuery::OnMouseDown)
|
|
|
|
|
[
|
|
|
|
|
SNew(SOverlay)
|
|
|
|
|
|
|
|
|
|
// INPUT PIN AREA
|
|
|
|
|
+SOverlay::Slot()
|
|
|
|
|
.HAlign(HAlign_Fill)
|
|
|
|
|
.VAlign(VAlign_Top)
|
|
|
|
|
[
|
|
|
|
|
SAssignNew(LeftNodeBox, SVerticalBox)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// OUTPUT PIN AREA
|
|
|
|
|
+SOverlay::Slot()
|
|
|
|
|
.HAlign(HAlign_Fill)
|
|
|
|
|
.VAlign(VAlign_Bottom)
|
|
|
|
|
[
|
|
|
|
|
SAssignNew(RightNodeBox, SVerticalBox)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// STATE NAME AREA
|
|
|
|
|
+SOverlay::Slot()
|
|
|
|
|
.HAlign(HAlign_Fill)
|
|
|
|
|
.VAlign(VAlign_Center)
|
|
|
|
|
.Padding(NodePadding)
|
|
|
|
|
[
|
|
|
|
|
SNew(SHorizontalBox)
|
|
|
|
|
+SHorizontalBox::Slot()
|
|
|
|
|
.VAlign(VAlign_Center)
|
|
|
|
|
.AutoWidth()
|
|
|
|
|
[
|
|
|
|
|
SNew(SCheckBox)
|
|
|
|
|
.Visibility(this, &SGraphNode_EnvironmentQuery::GetTestToggleVisibility)
|
|
|
|
|
.IsChecked(this, &SGraphNode_EnvironmentQuery::IsTestToggleChecked)
|
|
|
|
|
.OnCheckStateChanged(this, &SGraphNode_EnvironmentQuery::OnTestToggleChanged)
|
|
|
|
|
.Padding(FMargin(0, 0, 4.0f, 0))
|
|
|
|
|
]
|
|
|
|
|
+SHorizontalBox::Slot()
|
|
|
|
|
.FillWidth(1.0f)
|
|
|
|
|
[
|
|
|
|
|
SNew(SVerticalBox)
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
SNew(SBorder)
|
|
|
|
|
.BorderImage( FEditorStyle::GetBrush("Graph.StateNode.Body") )
|
|
|
|
|
.BorderBackgroundColor( this, &SGraphNode_EnvironmentQuery::GetBackgroundColor )
|
|
|
|
|
.HAlign(HAlign_Fill)
|
|
|
|
|
.VAlign(VAlign_Center)
|
|
|
|
|
.Visibility(EVisibility::SelfHitTestInvisible)
|
|
|
|
|
[
|
|
|
|
|
SNew(SVerticalBox)
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
.Padding(0,0,0,2)
|
|
|
|
|
[
|
|
|
|
|
SNew(SBox).HeightOverride(4)
|
|
|
|
|
[
|
|
|
|
|
// weight bar
|
|
|
|
|
SNew(SProgressBar)
|
|
|
|
|
.FillColorAndOpacity(this, &SGraphNode_EnvironmentQuery::GetWeightProgressBarColor)
|
|
|
|
|
.Visibility(this, &SGraphNode_EnvironmentQuery::GetWeightMarkerVisibility)
|
|
|
|
|
.Percent(this, &SGraphNode_EnvironmentQuery::GetWeightProgressBarPercent)
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
SNew(SHorizontalBox)
|
|
|
|
|
+SHorizontalBox::Slot()
|
|
|
|
|
.AutoWidth()
|
|
|
|
|
[
|
|
|
|
|
// POPUP ERROR MESSAGE
|
|
|
|
|
SAssignNew(ErrorText, SErrorText )
|
|
|
|
|
.BackgroundColor( this, &SGraphNode_EnvironmentQuery::GetErrorColor )
|
|
|
|
|
.ToolTipText( this, &SGraphNode_EnvironmentQuery::GetErrorMsgToolTip )
|
|
|
|
|
]
|
|
|
|
|
+SHorizontalBox::Slot()
|
|
|
|
|
.Padding(FMargin(4.0f, 0.0f, 4.0f, 0.0f))
|
|
|
|
|
[
|
|
|
|
|
SNew(SVerticalBox)
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
SAssignNew(InlineEditableText, SInlineEditableTextBlock)
|
|
|
|
|
.Style( FEditorStyle::Get(), "Graph.StateNode.NodeTitleInlineEditableText" )
|
|
|
|
|
.Text( NodeTitle.Get(), &SNodeTitle::GetHeadTitle )
|
|
|
|
|
.OnVerifyTextChanged(this, &SGraphNode_EnvironmentQuery::OnVerifyNameTextChanged)
|
|
|
|
|
.OnTextCommitted(this, &SGraphNode_EnvironmentQuery::OnNameTextCommited)
|
|
|
|
|
.IsReadOnly( this, &SGraphNode_EnvironmentQuery::IsNameReadOnly )
|
|
|
|
|
.IsSelected(this, &SGraphNode_EnvironmentQuery::IsSelectedExclusively)
|
|
|
|
|
]
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
NodeTitle.ToSharedRef()
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
// DESCRIPTION MESSAGE
|
|
|
|
|
SAssignNew(DescriptionText, STextBlock )
|
|
|
|
|
.Text(this, &SGraphNode_EnvironmentQuery::GetDescription)
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
.Padding(0, TestPadding, 0, 0)
|
|
|
|
|
[
|
|
|
|
|
TestBox.ToSharedRef()
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
//drag marker overlay
|
|
|
|
|
+SOverlay::Slot()
|
|
|
|
|
.HAlign(HAlign_Fill)
|
|
|
|
|
.VAlign(VAlign_Top)
|
|
|
|
|
[
|
|
|
|
|
SNew(SBorder)
|
|
|
|
|
.BorderBackgroundColor(EnvironmentQueryColors::Action::DragMarker)
|
|
|
|
|
.ColorAndOpacity(EnvironmentQueryColors::Action::DragMarker)
|
|
|
|
|
.BorderImage(FEditorStyle::GetBrush("Graph.StateNode.Body"))
|
|
|
|
|
.Visibility(this, &SGraphNode_EnvironmentQuery::GetDragOverMarkerVisibility)
|
|
|
|
|
[
|
|
|
|
|
SNew(SBox)
|
|
|
|
|
.HeightOverride(4)
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
|
2015-02-23 15:58:14 -05:00
|
|
|
// Create comment bubble
|
|
|
|
|
TSharedPtr<SCommentBubble> CommentBubble;
|
|
|
|
|
|
|
|
|
|
SAssignNew(CommentBubble, SCommentBubble)
|
|
|
|
|
.GraphNode(GraphNode)
|
|
|
|
|
.Text(this, &SGraphNode::GetNodeComment)
|
|
|
|
|
.ColorAndOpacity(this, &SGraphNode_EnvironmentQuery::GetCommentColor)
|
|
|
|
|
.AllowPinning(true)
|
|
|
|
|
.EnableTitleBarBubble(true)
|
|
|
|
|
.EnableBubbleCtrls(true)
|
|
|
|
|
.GraphLOD(this, &SGraphNode::GetCurrentLOD)
|
|
|
|
|
.IsGraphNodeHovered(this, &SGraphNode::IsHovered);
|
|
|
|
|
|
|
|
|
|
GetOrAddSlot(ENodeZone::TopCenter)
|
|
|
|
|
.SlotOffset(TAttribute<FVector2D>(CommentBubble.Get(), &SCommentBubble::GetOffset))
|
|
|
|
|
.SlotSize(TAttribute<FVector2D>(CommentBubble.Get(), &SCommentBubble::GetSize))
|
|
|
|
|
.AllowScaling(TAttribute<bool>(CommentBubble.Get(), &SCommentBubble::IsScalingAllowed))
|
|
|
|
|
.VAlign(VAlign_Top)
|
|
|
|
|
[
|
|
|
|
|
CommentBubble.ToSharedRef()
|
|
|
|
|
];
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
ErrorReporting = ErrorText;
|
|
|
|
|
ErrorReporting->SetError(ErrorMsg);
|
|
|
|
|
CreatePinWidgets();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SGraphNode_EnvironmentQuery::CreatePinWidgets()
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* StateNode = CastChecked<UEnvironmentQueryGraphNode>(GraphNode);
|
|
|
|
|
|
|
|
|
|
UEdGraphPin* CurPin = StateNode->GetOutputPin();
|
|
|
|
|
if (CurPin && !CurPin->bHidden)
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<SGraphPin> NewPin = SNew(SEnvironmentQueryPin, CurPin);
|
|
|
|
|
|
|
|
|
|
NewPin->SetIsEditable(IsEditable);
|
2015-02-23 10:30:16 -05:00
|
|
|
AddPin(NewPin.ToSharedRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CurPin = StateNode->GetInputPin();
|
|
|
|
|
if (CurPin && !CurPin->bHidden)
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<SGraphPin> NewPin = SNew(SEnvironmentQueryPin, CurPin);
|
|
|
|
|
|
|
|
|
|
NewPin->SetIsEditable(IsEditable);
|
2015-02-23 10:30:16 -05:00
|
|
|
AddPin(NewPin.ToSharedRef());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EVisibility SGraphNode_EnvironmentQuery::GetWeightMarkerVisibility() const
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
|
|
|
|
return MyTestNode ? EVisibility::Visible : EVisibility::Collapsed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TOptional<float> SGraphNode_EnvironmentQuery::GetWeightProgressBarPercent() const
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
|
|
|
|
return MyTestNode ? FMath::Max(0.0f, MyTestNode->TestWeightPct) : TOptional<float>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSlateColor SGraphNode_EnvironmentQuery::GetWeightProgressBarColor() const
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
|
|
|
|
return (MyTestNode && MyTestNode->bHasNamedWeight) ? EnvironmentQueryColors::Action::WeightNamed : EnvironmentQueryColors::Action::Weight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EVisibility SGraphNode_EnvironmentQuery::GetTestToggleVisibility() const
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
|
|
|
|
return MyTestNode ? EVisibility::Visible : EVisibility::Collapsed;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-10 14:24:09 -05:00
|
|
|
ECheckBoxState SGraphNode_EnvironmentQuery::IsTestToggleChecked() const
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
2014-12-10 14:24:09 -05:00
|
|
|
return MyTestNode && MyTestNode->bTestEnabled ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-12-10 14:24:09 -05:00
|
|
|
void SGraphNode_EnvironmentQuery::OnTestToggleChanged(ECheckBoxState NewState)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* MyTestNode = Cast<UEnvironmentQueryGraphNode_Test>(GraphNode);
|
|
|
|
|
if (MyTestNode)
|
|
|
|
|
{
|
2014-12-10 14:24:09 -05:00
|
|
|
MyTestNode->bTestEnabled = (NewState == ECheckBoxState::Checked);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode_Option* MyParentNode = Cast<UEnvironmentQueryGraphNode_Option>(MyTestNode->ParentNode);
|
|
|
|
|
if (MyParentNode)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
MyParentNode->CalculateWeights();
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UEnvironmentQueryGraph* MyGraph = Cast<UEnvironmentQueryGraph>(MyTestNode->GetGraph());
|
|
|
|
|
if (MyGraph)
|
|
|
|
|
{
|
|
|
|
|
MyGraph->UpdateAsset();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|