MCPcopy Create free account
hub / github.com/MothCocoon/FlowGraph / OnLogTokenClicked

Method OnLogTokenClicked

Source/FlowEditor/Private/Asset/FlowAssetEditor.cpp:571–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569#endif
570
571void FFlowAssetEditor::OnLogTokenClicked(const TSharedRef<IMessageToken>& Token) const
572{
573 if (Token->GetType() == EMessageToken::Object)
574 {
575 const TSharedRef<FUObjectToken> ObjectToken = StaticCastSharedRef<FUObjectToken>(Token);
576 if (const UObject* Object = ObjectToken->GetObject().Get())
577 {
578 if (Object->IsAsset())
579 {
580 GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->OpenEditorForAsset(const_cast<UObject*>(Object));
581 }
582 else
583 {
584 UE_LOG(LogFlowEditor, Warning, TEXT("Unknown type of hyperlinked object (%s), cannot focus it"), *GetNameSafe(Object));
585 }
586 }
587 }
588 else if (Token->GetType() == EMessageToken::EdGraph && GraphEditor.IsValid())
589 {
590 const TSharedRef<FFlowGraphToken> EdGraphToken = StaticCastSharedRef<FFlowGraphToken>(Token);
591
592 if (const UEdGraphPin* GraphPin = EdGraphToken->GetPin())
593 {
594 if (!GraphPin->IsPendingKill())
595 {
596 GraphEditor->JumpToPin(GraphPin);
597 }
598 }
599 else if (const UEdGraphNode* GraphNode = EdGraphToken->GetGraphNode())
600 {
601 GraphEditor->JumpToNode(GraphNode, true);
602 }
603 }
604}
605
606void FFlowAssetEditor::JumpToNode(const UEdGraphNode* Node) const
607{

Callers

nothing calls this directly

Calls 3

GetMethod · 0.80
IsValidMethod · 0.80
JumpToNodeMethod · 0.80

Tested by

no test coverage detected