Halfway through with repair of right-click menus
This commit is contained in:
@@ -471,55 +471,6 @@ UAnimStateTransitionNode* WingUtils::FindTransition(UAnimationStateMachineGraph*
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Graph actions (node spawning)
|
||||
// ============================================================
|
||||
|
||||
FString WingUtils::ActionFullName(const TSharedPtr<FEdGraphSchemaAction>& Action)
|
||||
{
|
||||
FString Category = Action->GetCategory().ToString();
|
||||
FString MenuName = Action->GetMenuDescription().ToString();
|
||||
if (Category.IsEmpty())
|
||||
return MenuName;
|
||||
return Category + TEXT("|") + MenuName;
|
||||
}
|
||||
|
||||
TArray<TSharedPtr<FEdGraphSchemaAction>> WingUtils::SearchGraphActions(UEdGraph* Graph, const FString& Query, int32 MaxResults, bool ExactMatch)
|
||||
{
|
||||
FString QueryLower = Query.ToLower();
|
||||
TArray<TSharedPtr<FEdGraphSchemaAction>> Result;
|
||||
|
||||
FGraphContextMenuBuilder ContextMenuBuilder(Graph);
|
||||
Graph->GetSchema()->GetGraphContextActions(ContextMenuBuilder);
|
||||
|
||||
for (int32 i = 0; i < ContextMenuBuilder.GetNumActions(); i++)
|
||||
{
|
||||
TSharedPtr<FEdGraphSchemaAction> Action = ContextMenuBuilder.GetSchemaAction(i);
|
||||
if (!Action.IsValid()) continue;
|
||||
|
||||
FString FullName = ActionFullName(Action);
|
||||
if (FullName.IsEmpty()) continue;
|
||||
|
||||
if (ExactMatch)
|
||||
{
|
||||
if (FullName.ToLower() != QueryLower)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
FString Keywords = Action->GetKeywords().ToString();
|
||||
if (!FullName.ToLower().Contains(QueryLower) && !Keywords.ToLower().Contains(QueryLower))
|
||||
continue;
|
||||
}
|
||||
|
||||
Result.Add(Action);
|
||||
if ((MaxResults > 0) && (Result.Num() >= MaxResults))
|
||||
break;
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Support for locating UE Wingman Handlers
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user