| 976 | } |
| 977 | |
| 978 | void UFlowNode::TriggerInput(const FName& PinName, const EFlowPinActivationType ActivationType /*= Default*/) |
| 979 | { |
| 980 | if (SignalMode == EFlowSignalMode::Disabled) |
| 981 | { |
| 982 | // entirely ignore any Input activation |
| 983 | } |
| 984 | |
| 985 | if (InputPins.Contains(PinName)) |
| 986 | { |
| 987 | if (SignalMode == EFlowSignalMode::Enabled) |
| 988 | { |
| 989 | const EFlowNodeState PreviousActivationState = ActivationState; |
| 990 | if (PreviousActivationState != EFlowNodeState::Active) |
| 991 | { |
| 992 | OnActivate(); |
| 993 | } |
| 994 | |
| 995 | ActivationState = EFlowNodeState::Active; |
| 996 | } |
| 997 | |
| 998 | #if !UE_BUILD_SHIPPING |
| 999 | // record for debugging |
| 1000 | TArray<FPinRecord>& Records = InputRecords.FindOrAdd(PinName); |
| 1001 | Records.Add(FPinRecord(FApp::GetCurrentTime(), ActivationType)); |
| 1002 | |
| 1003 | if (const UFlowAsset* FlowAssetTemplate = GetFlowAsset()->GetTemplateAsset()) |
| 1004 | { |
| 1005 | (void)FlowAssetTemplate->OnPinTriggered.ExecuteIfBound(this, PinName); |
| 1006 | } |
| 1007 | #endif |
| 1008 | } |
| 1009 | #if !UE_BUILD_SHIPPING |
| 1010 | else |
| 1011 | { |
| 1012 | LogError(FString::Printf(TEXT("Input Pin name %s invalid"), *PinName.ToString())); |
| 1013 | return; |
| 1014 | } |
| 1015 | #endif |
| 1016 | |
| 1017 | switch (SignalMode) |
| 1018 | { |
| 1019 | case EFlowSignalMode::Enabled: |
| 1020 | ExecuteInputForSelfAndAddOns(PinName); |
| 1021 | break; |
| 1022 | case EFlowSignalMode::Disabled: |
| 1023 | if (GetDefault<UFlowSettings>()->bLogOnSignalDisabled) |
| 1024 | { |
| 1025 | LogNote(FString::Printf(TEXT("Node disabled while triggering input %s"), *PinName.ToString())); |
| 1026 | } |
| 1027 | break; |
| 1028 | case EFlowSignalMode::PassThrough: |
| 1029 | if (GetDefault<UFlowSettings>()->bLogOnSignalPassthrough) |
| 1030 | { |
| 1031 | LogNote(FString::Printf(TEXT("Signal pass-through on triggering input %s"), *PinName.ToString())); |
| 1032 | } |
| 1033 | OnPassThrough(); |
| 1034 | break; |
| 1035 | default: ; |
no test coverage detected