Combo Action Graph is basically finished. The hard part, anyway.
This commit is contained in:
@@ -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