Combo Action Graph is basically finished. The hard part, anyway.
This commit is contained in:
@@ -21,28 +21,28 @@ UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewNode::PerformAction(U
|
||||
{
|
||||
UEdGraphNode *ResultNode = nullptr;
|
||||
|
||||
if (NodeTemplate != nullptr)
|
||||
if (this->NodeTemplate != nullptr)
|
||||
{
|
||||
const FScopedTransaction Transaction(LOCTEXT("ComboActionGraphEditorNewNode", "Combo Action Graph Editor: New Node"));
|
||||
ParentGraph->Modify();
|
||||
if (FromPin != nullptr)
|
||||
FromPin->Modify();
|
||||
|
||||
NodeTemplate->Rename(nullptr, ParentGraph);
|
||||
ParentGraph->AddNode(NodeTemplate, true, bSelectNewNode);
|
||||
this->NodeTemplate->Rename(nullptr, ParentGraph);
|
||||
ParentGraph->AddNode(this->NodeTemplate, true, bSelectNewNode);
|
||||
|
||||
NodeTemplate->CreateNewGuid();
|
||||
NodeTemplate->PostPlacedNewNode();
|
||||
NodeTemplate->AllocateDefaultPins();
|
||||
NodeTemplate->AutowireNewNode(FromPin);
|
||||
this->NodeTemplate->CreateNewGuid();
|
||||
this->NodeTemplate->PostPlacedNewNode();
|
||||
this->NodeTemplate->AllocateDefaultPins();
|
||||
this->NodeTemplate->AutowireNewNode(FromPin);
|
||||
|
||||
NodeTemplate->NodePosX = Location.X;
|
||||
NodeTemplate->NodePosY = Location.Y;
|
||||
this->NodeTemplate->NodePosX = Location.X;
|
||||
this->NodeTemplate->NodePosY = Location.Y;
|
||||
|
||||
NodeTemplate->ComboActionGraphNode->SetFlags(EObjectFlags::RF_Transactional);
|
||||
NodeTemplate->SetFlags(EObjectFlags::RF_Transactional);
|
||||
this->NodeTemplate->ComboActionGraphNode->SetFlags(EObjectFlags::RF_Transactional);
|
||||
this->NodeTemplate->SetFlags(EObjectFlags::RF_Transactional);
|
||||
|
||||
ResultNode = NodeTemplate;
|
||||
ResultNode = this->NodeTemplate;
|
||||
}
|
||||
|
||||
return ResultNode;
|
||||
@@ -51,35 +51,35 @@ UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewNode::PerformAction(U
|
||||
void FAssetSchemaAction_ComboActionGraphSchema_NewNode::AddReferencedObjects(FReferenceCollector &Collector)
|
||||
{
|
||||
FEdGraphSchemaAction::AddReferencedObjects(Collector);
|
||||
Collector.AddReferencedObject(NodeTemplate);
|
||||
Collector.AddReferencedObject(this->NodeTemplate);
|
||||
}
|
||||
|
||||
UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewEdge::PerformAction(UEdGraph *ParentGraph, UEdGraphPin *FromPin, const FVector2D Location, bool bSelectNewNode)
|
||||
{
|
||||
UEdGraphNode *ResultNode = nullptr;
|
||||
|
||||
if (NodeTemplate != nullptr)
|
||||
if (this->NodeTemplate != nullptr)
|
||||
{
|
||||
const FScopedTransaction Transaction(LOCTEXT("ComboActionGraphEditorNewEdge", "Combo Action Graph Editor: New Edge"));
|
||||
ParentGraph->Modify();
|
||||
if (FromPin != nullptr)
|
||||
FromPin->Modify();
|
||||
|
||||
NodeTemplate->Rename(nullptr, ParentGraph);
|
||||
ParentGraph->AddNode(NodeTemplate, true, bSelectNewNode);
|
||||
this->NodeTemplate->Rename(nullptr, ParentGraph);
|
||||
ParentGraph->AddNode(this->NodeTemplate, true, bSelectNewNode);
|
||||
|
||||
NodeTemplate->CreateNewGuid();
|
||||
NodeTemplate->PostPlacedNewNode();
|
||||
NodeTemplate->AllocateDefaultPins();
|
||||
NodeTemplate->AutowireNewNode(FromPin);
|
||||
this->NodeTemplate->CreateNewGuid();
|
||||
this->NodeTemplate->PostPlacedNewNode();
|
||||
this->NodeTemplate->AllocateDefaultPins();
|
||||
this->NodeTemplate->AutowireNewNode(FromPin);
|
||||
|
||||
NodeTemplate->NodePosX = Location.X;
|
||||
NodeTemplate->NodePosY = Location.Y;
|
||||
this->NodeTemplate->NodePosX = Location.X;
|
||||
this->NodeTemplate->NodePosY = Location.Y;
|
||||
|
||||
NodeTemplate->ComboActionGraphEdge->SetFlags(EObjectFlags::RF_Transactional);
|
||||
NodeTemplate->SetFlags(EObjectFlags::RF_Transactional);
|
||||
this->NodeTemplate->ComboActionGraphEdge->SetFlags(EObjectFlags::RF_Transactional);
|
||||
this->NodeTemplate->SetFlags(EObjectFlags::RF_Transactional);
|
||||
|
||||
ResultNode = NodeTemplate;
|
||||
ResultNode = this->NodeTemplate;
|
||||
}
|
||||
|
||||
return ResultNode;
|
||||
@@ -88,7 +88,7 @@ UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewEdge::PerformAction(U
|
||||
void FAssetSchemaAction_ComboActionGraphSchema_NewEdge::AddReferencedObjects(FReferenceCollector &Collector)
|
||||
{
|
||||
FEdGraphSchemaAction::AddReferencedObjects(Collector);
|
||||
Collector.AddReferencedObject(NodeTemplate);
|
||||
Collector.AddReferencedObject(this->NodeTemplate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ FText UEdComboActionGraphNode::GetTooltipText() const
|
||||
return this->ComboActionGraphNode->GetNodeTooltipText();
|
||||
}
|
||||
|
||||
return NSLOCTEXT("UEdComboActionGraphNode", "DefaultToolTip", "Mountea Dialogue Node");
|
||||
return NSLOCTEXT("UEdComboActionGraphNode", "DefaultToolTip", "Combo Action Node");
|
||||
}
|
||||
|
||||
FSlateIcon UEdComboActionGraphNode::GetIconAndTint(FLinearColor& OutColor) const
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,9 +41,6 @@ public:
|
||||
|
||||
virtual const FSlateBrush *GetNameIcon() const;
|
||||
|
||||
virtual const FSlateBrush *GetInheritsImageBrush() const;
|
||||
virtual FSlateColor GetInheritsImageTint() const;
|
||||
|
||||
const FSlateBrush *GetBulletPointImageBrush() const;
|
||||
|
||||
virtual FText GetIndexOverlayTooltipText() const;
|
||||
@@ -54,30 +51,21 @@ public:
|
||||
|
||||
virtual void OnIndexHoverStateChanged(bool bArg) const;
|
||||
virtual FSlateColor GetOverlayWidgetBackgroundColor(bool bArg) const;
|
||||
|
||||
bool HasGraphDecorators() const;
|
||||
bool HasNodeDecorators() const;
|
||||
|
||||
virtual FText GetDecoratorsText() const;
|
||||
virtual FText GetNumberOfDecorators() const;
|
||||
virtual FText GetDecoratorsInheritanceText() const;
|
||||
|
||||
EVisibility ShowImplementsOnlySlot_Unified() const;
|
||||
EVisibility ShowInheritsDecoratorsSlot_Unified() const;
|
||||
EVisibility ShowImplementsOnlySlot_Stack() const;
|
||||
EVisibility ShowInheritsDecoratorsSlot_Stack() const;
|
||||
EVisibility ShowAllDecorators() const;
|
||||
EVisibility ShowDecoratorsBottomPadding() const;
|
||||
|
||||
FSlateColor GetImplementsRowColor() const;
|
||||
FSlateColor GetBulletPointsImagePointColor() const;
|
||||
|
||||
virtual EComboActionDecoratorsInfoStyle GetDecoratorsStyle() const;
|
||||
EVisibility GetStackVisibility() const;
|
||||
EVisibility GetUnifiedVisibility() const;
|
||||
EVisibility GetResponseStackVisibility() const;
|
||||
|
||||
FText GetTooltipText() const;
|
||||
|
||||
FText GetComboInputName() const;
|
||||
FText GetComboInputTriggerActionName() const;
|
||||
|
||||
protected:
|
||||
TSharedPtr<SBorder> NodeBody;
|
||||
TSharedPtr<SHorizontalBox> OutputPinBox;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
#include "ComboInputAssets.h"
|
||||
#include "Ed/EdComboActionGraphNode.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Nodes/ComboActionGraphNode.h"
|
||||
@@ -26,7 +27,10 @@ public:
|
||||
#if WITH_EDITOR
|
||||
static FText GetNodeTitle(UComboActionGraphNode *Node)
|
||||
{
|
||||
if (!Node) return FText::FromString("Invalid Node");
|
||||
if (!Node)
|
||||
{
|
||||
return FText::FromString("Invalid Node");
|
||||
}
|
||||
|
||||
const UComboActionGraphEditorSettings *Settings = GetDefault<UComboActionGraphEditorSettings>();
|
||||
if (Settings)
|
||||
@@ -35,12 +39,9 @@ public:
|
||||
{
|
||||
if (const UComboActionGraphNode_ActionNodeBase *DialogueNodeBase = Cast<UComboActionGraphNode_ActionNodeBase>(Node))
|
||||
{
|
||||
if (DialogueNodeBase->GetDataTable())
|
||||
if (const UComboInputAsset *ComboInput = DialogueNodeBase->GetComboInput())
|
||||
{
|
||||
FString ReturnString;
|
||||
DialogueNodeBase->GetRowName().ToString(ReturnString);
|
||||
|
||||
return FText::FromString(ReturnString);
|
||||
return FText::FromString(ComboInput->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,21 +8,18 @@ struct FComboActionSearchFilter
|
||||
public:
|
||||
bool IsEmptyFilter() const
|
||||
{
|
||||
return SearchString.IsEmpty()
|
||||
&& bIncludeNodeTitle == false
|
||||
&& bIncludeNodeType == false
|
||||
&& bIncludeNodeDecoratorsTypes == false
|
||||
&& bIncludeNodeData == true
|
||||
&& bIncludeNodeGUID == false;
|
||||
return this->SearchString.IsEmpty()
|
||||
&& this->bIncludeNodeTitle == false
|
||||
&& this->bIncludeNodeType == false
|
||||
&& this->bIncludeNodeData == true
|
||||
&& this->bIncludeNodeGUID == false;
|
||||
}
|
||||
|
||||
public:
|
||||
// Search term that the search items must match
|
||||
FString SearchString;
|
||||
|
||||
bool bIncludeNodeTitle = true;
|
||||
bool bIncludeNodeType = true;
|
||||
bool bIncludeNodeDecoratorsTypes = true;
|
||||
bool bIncludeNodeData = true;
|
||||
bool bIncludeNodeGUID = false;
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "ComboActionSearchManager.h"
|
||||
|
||||
#include "ComboActionGraph.h"
|
||||
#include "ComboInputAssets.h"
|
||||
|
||||
#include "AssetRegistry/AssetRegistryModule.h"
|
||||
#include "Ed/EdComboActionGraph.h"
|
||||
@@ -73,34 +74,17 @@ bool FComboActionSearchManager::QueryGraphNode(const FComboActionSearchFilter &S
|
||||
}
|
||||
}
|
||||
|
||||
// Search by Decorators
|
||||
if (SearchFilter.bIncludeNodeDecoratorsTypes)
|
||||
{
|
||||
const TArray<FComboActionDecorator> &NodeDecorators = Node->GetNodeDecorators();
|
||||
for (int32 Index = 0, Num = NodeDecorators.Num(); Index < Num; Index++)
|
||||
{
|
||||
bContainsSearchString = this->QueryNodeDecorators(
|
||||
SearchFilter,
|
||||
NodeDecorators[Index],
|
||||
TreeGraphNode,
|
||||
Index,
|
||||
TEXT("DecoratorType")
|
||||
)
|
||||
|| bContainsSearchString;
|
||||
}
|
||||
}
|
||||
|
||||
// Search by Node Data
|
||||
if (SearchFilter.bIncludeNodeData)
|
||||
{
|
||||
if (const UComboActionGraphNode_ActionNodeBase *ActionNodeBase = Cast<UComboActionGraphNode_ActionNodeBase>(Node))
|
||||
{
|
||||
if (ActionNodeBase->GetRowName().ToString().Contains(SearchFilter.SearchString))
|
||||
if (ActionNodeBase->GetComboInput()->GetName().Contains(SearchFilter.SearchString))
|
||||
{
|
||||
bContainsSearchString = true;
|
||||
this->MakeChildTextNode(
|
||||
TreeGraphNode,
|
||||
FText::FromName(FName(Node->NodeTypeName.ToString() )),
|
||||
FText::FromName(FName(Node->NodeTypeName.ToString())),
|
||||
LOCTEXT("NodeDataRowKey", "Node Data"),
|
||||
TEXT("Node Data")
|
||||
);
|
||||
|
||||
@@ -339,26 +339,6 @@ TSharedRef<SWidget> SComboActionSearch::FillFilterEntries()
|
||||
EUserInterfaceActionType::ToggleButton
|
||||
);
|
||||
MenuBuilder.AddMenuEntry
|
||||
(
|
||||
LOCTEXT("IncludeNodeDecoratorsTypes", "Include Node Decorators"),
|
||||
LOCTEXT("IncludeNodeDecoratorsTypes_ToolTip", "Include Node Decorators Types (by name) in the search result"),
|
||||
FSlateIcon(),
|
||||
FUIAction(
|
||||
FExecuteAction::CreateLambda([this]()
|
||||
{
|
||||
this->CurrentFilter.bIncludeNodeDecoratorsTypes = !this->CurrentFilter.bIncludeNodeDecoratorsTypes;
|
||||
this->MakeSearchQuery(this->CurrentFilter);
|
||||
}),
|
||||
FCanExecuteAction(),
|
||||
FIsActionChecked::CreateLambda([this]() -> bool
|
||||
{
|
||||
return this->CurrentFilter.bIncludeNodeDecoratorsTypes;
|
||||
})
|
||||
),
|
||||
NAME_None,
|
||||
EUserInterfaceActionType::ToggleButton
|
||||
);
|
||||
MenuBuilder.AddMenuEntry
|
||||
(
|
||||
LOCTEXT("IncludeNodeData", "Include Node Data Row"),
|
||||
LOCTEXT("IncludeNodeDecoratorsTypes_ToolTip", "Include Node Data Row in the search result"),
|
||||
|
||||
Reference in New Issue
Block a user