diff --git a/Source/EnhancedCodeFlow/Private/BP/ECFBPLibrary.cpp b/Source/EnhancedCodeFlow/Private/BP/ECFBPLibrary.cpp index 20fcbcc..5ef7544 100644 --- a/Source/EnhancedCodeFlow/Private/BP/ECFBPLibrary.cpp +++ b/Source/EnhancedCodeFlow/Private/BP/ECFBPLibrary.cpp @@ -184,4 +184,9 @@ FString UECFBPLibrary::Conv_ECFInstanceIdToString(const FECFInstanceIdBP& Instan /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ +FECFHandleBP UECFBPLibrary::FindActionByLabel(const UObject* WorldContextObject, const FString& Label) +{ + return FECFHandleBP(FFlow::FindActionByLabel(WorldContextObject, Label)); +} + ECF_PRAGMA_ENABLE_OPTIMIZATION \ No newline at end of file diff --git a/Source/EnhancedCodeFlow/Private/ECFSubsystem.cpp b/Source/EnhancedCodeFlow/Private/ECFSubsystem.cpp index e0b5516..abb1915 100644 --- a/Source/EnhancedCodeFlow/Private/ECFSubsystem.cpp +++ b/Source/EnhancedCodeFlow/Private/ECFSubsystem.cpp @@ -138,6 +138,31 @@ UECFActionBase* UECFSubsystem::FindAction(const FECFHandle& HandleId) const return nullptr; } +FECFHandle UECFSubsystem::FindActionByLabel(const FString& Label) const +{ + if (Label.IsEmpty()) + { + return FECFHandle(); + } + // Search in active actions + for (UECFActionBase* Action : Actions) + { + if (IsActionValid(Action) && Action->Settings.Label == Label) + { + return Action->GetHandleId(); + } + } + // Search in pending actions + for (UECFActionBase* PendingAction : PendingAddActions) + { + if (IsActionValid(PendingAction) && PendingAction->Settings.Label == Label) + { + return PendingAction->GetHandleId(); + } + } + return FECFHandle(); +} + void UECFSubsystem::PauseAction(const FECFHandle& HandleId) { if (UECFActionBase* ActionFound = FindAction(HandleId)) diff --git a/Source/EnhancedCodeFlow/Private/EnhancedCodeFlow.cpp b/Source/EnhancedCodeFlow/Private/EnhancedCodeFlow.cpp index a081a39..e97cad9 100644 --- a/Source/EnhancedCodeFlow/Private/EnhancedCodeFlow.cpp +++ b/Source/EnhancedCodeFlow/Private/EnhancedCodeFlow.cpp @@ -589,4 +589,11 @@ void FEnhancedCodeFlow::RemoveAllRunAsyncAndWait(const UObject* WorldContextObje ECF->RemoveActionsOfClass(bComplete, InOwner); } +FECFHandle FEnhancedCodeFlow::FindActionByLabel(const UObject* WorldContextObject, const FString& Label) +{ + if (UECFSubsystem* ECF = UECFSubsystem::Get(WorldContextObject)) + return ECF->FindActionByLabel(Label); + return FECFHandle(); +} + ECF_PRAGMA_ENABLE_OPTIMIZATION diff --git a/Source/EnhancedCodeFlow/Public/BP/ECFBPLibrary.h b/Source/EnhancedCodeFlow/Public/BP/ECFBPLibrary.h index 93df246..7d13b15 100644 --- a/Source/EnhancedCodeFlow/Public/BP/ECFBPLibrary.h +++ b/Source/EnhancedCodeFlow/Public/BP/ECFBPLibrary.h @@ -261,5 +261,11 @@ class ENHANCEDCODEFLOW_API UECFBPLibrary : public UBlueprintFunctionLibrary UFUNCTION(BlueprintPure, meta = (DisplayName = "ToString (FECFInstanceIdBP)", CompactNodeTitle = "->", BlueprintAutocast), Category = "ECF") static FString Conv_ECFInstanceIdToString(const FECFInstanceIdBP& InstanceId); + /** + * Finds the first running or pending action with the given Label and returns its handle (for Blueprints). + */ + UFUNCTION(BlueprintPure, meta = (WorldContext = "WorldContextObject", DisplayName = "ECF - Find Action By Label"), Category = "ECF") + static FECFHandleBP FindActionByLabel(const UObject* WorldContextObject, const FString& Label); + /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ }; diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimeline.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimeline.h index 666a44c..3935492 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimeline.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimeline.h @@ -46,7 +46,7 @@ class ENHANCEDCODEFLOW_API UECFCustomTimeline : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - custom timeline failed to start. Are you sure Tick Function and Curve are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] custom timeline failed to start. Are you sure Tick Function and Curve are set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineLinearColor.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineLinearColor.h index 5392eee..dba2267 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineLinearColor.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineLinearColor.h @@ -46,7 +46,7 @@ class ENHANCEDCODEFLOW_API UECFCustomTimelineLinearColor : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - custom timeline LinearColor failed to start. Are you sure Tick Function and Curve are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] custom timeline LinearColor failed to start. Are you sure Tick Function and Curve are set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineVector.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineVector.h index 9c4a57e..b5d8c91 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineVector.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFCustomTimelineVector.h @@ -46,7 +46,7 @@ class ENHANCEDCODEFLOW_API UECFCustomTimelineVector : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - custom timeline vector failed to start. Are you sure Tick Function and Curve are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] custom timeline vector failed to start. Are you sure Tick Function and Curve are set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelay.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelay.h index c6e7327..28ff7b7 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelay.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelay.h @@ -37,7 +37,7 @@ class ENHANCEDCODEFLOW_API UECFDelay : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - delay failed to start. Are you sure the DelayTime is not negative and Callback Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] delay failed to start. Are you sure the DelayTime is not negative and Callback Function is set properly?"), *Settings.Label); #endif return false; } @@ -56,7 +56,7 @@ class ENHANCEDCODEFLOW_API UECFDelay : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - delay failed to start. Are you sure the Callback Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] delay failed to start. Are you sure the Callback Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelayTicks.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelayTicks.h index 5b82d70..5e56024 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelayTicks.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDelayTicks.h @@ -33,7 +33,7 @@ class ENHANCEDCODEFLOW_API UECFDelayTicks : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - delay ticks failed to start. Are you sure the DelayTicks is not negative and Callback Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] delay ticks failed to start. Are you sure the DelayTicks is not negative and Callback Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNTimes.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNTimes.h index 07eec3e..9e69bf1 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNTimes.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNTimes.h @@ -32,7 +32,7 @@ class ENHANCEDCODEFLOW_API UECFDoNTimes : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - DoNTimes failed to start. Are you sure Exec Fuinction and Times number are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Do N Times failed to start. Are you sure the Exec Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNoMoreThanXTime.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNoMoreThanXTime.h index 115f4ae..fa5b5e9 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNoMoreThanXTime.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoNoMoreThanXTime.h @@ -36,7 +36,7 @@ class ENHANCEDCODEFLOW_API UECFDoNoMoreThanXTime : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Do No More Than Times failed to start. Are you sure the Lock time and Max Execs Eneueud are greater than 0 and the Exec Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Do No More Than Times failed to start. Are you sure the Lock time and Max Execs Eneueud are greater than 0 and the Exec Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoOnce.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoOnce.h index ccbca4a..2cb813b 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoOnce.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFDoOnce.h @@ -30,7 +30,7 @@ class ENHANCEDCODEFLOW_API UECFDoOnce : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - do once failed to start. Are you sure the Exec Function is is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] do once failed to start. Are you sure the Exec Function is is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFRunAsyncThen.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFRunAsyncThen.h index aa8e1c8..54595bd 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFRunAsyncThen.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFRunAsyncThen.h @@ -81,7 +81,7 @@ class ENHANCEDCODEFLOW_API UECFRunAsyncThen : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Run Async Task and Run failed to start. Are you sure the AsyncTask and Function are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Run Async Task and Run failed to start. Are you sure the AsyncTask and Function are set properly?"), *Settings.Label); #endif return false; } @@ -100,7 +100,7 @@ class ENHANCEDCODEFLOW_API UECFRunAsyncThen : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Run Async Task and Run failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Run Async Task and Run failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } @@ -119,7 +119,7 @@ class ENHANCEDCODEFLOW_API UECFRunAsyncThen : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Run Async Task and Run failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Run Async Task and Run failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTicker.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTicker.h index c9f0d24..e59ab88 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTicker.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTicker.h @@ -43,7 +43,7 @@ class ENHANCEDCODEFLOW_API UECFTicker : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Ticker(2) failed to start. Are you sure the Ticking time and Ticking Function are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] ticker failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeLock.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeLock.h index 9eea8b8..d370615 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeLock.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeLock.h @@ -33,7 +33,7 @@ class ENHANCEDCODEFLOW_API UECFTimeLock : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Timelock failed to start. Are you sure the Lock time is greater than 0 and the Exec Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Timelock failed to start. Are you sure the Lock time is greater than 0 and the Exec Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeline.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeline.h index dd5fd19..b37917e 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeline.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimeline.h @@ -70,7 +70,7 @@ class ENHANCEDCODEFLOW_API UECFTimeline : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Timeline failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly? /n Remember, that BlendExp must be different than zero and StartValue and StopValue must not be the same!")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Timeline failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly? /n Remember, that BlendExp must be different than zero and StartValue and StopValue must not be the same!"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineLinearColor.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineLinearColor.h index 741821b..32d6ba0 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineLinearColor.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineLinearColor.h @@ -70,7 +70,7 @@ class ENHANCEDCODEFLOW_API UECFTimelineLinearColor: public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Timeline Linear Color failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly? /n Remember, that BlendExp must be different than zero and StartValue and StopValue must not be the same!")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Timeline Linear Color failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly? /n Remember, that BlendExp must be different than zero and StartValue and StopValue must not be the same!"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineVector.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineVector.h index f0e9b8e..aa4cb5a 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineVector.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFTimelineVector.h @@ -70,7 +70,7 @@ class ENHANCEDCODEFLOW_API UECFTimelineVector : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Timeline Vector failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly? /n Remember, that BlendExp must be different than zero and StartValue and StopValue must not be the same!")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Timeline Vector failed to start. Are you sure the Ticking time is greater than 0 and Ticking Function are set properly? /n Remember, that BlendExp must be different than zero and StartValue and StopValue must not be the same!"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWaitAndExecute.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWaitAndExecute.h index e9574fa..8871f97 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWaitAndExecute.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWaitAndExecute.h @@ -60,7 +60,7 @@ class ENHANCEDCODEFLOW_API UECFWaitAndExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Wait and Execute failed to start. Are you sure the Predicate and Function are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Wait and Execute failed to start. Are you sure the Predicate and Function are set properly?"), *Settings.Label); #endif return false; } @@ -82,7 +82,7 @@ class ENHANCEDCODEFLOW_API UECFWaitAndExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Wait and Execute failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Wait and Execute failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } @@ -104,7 +104,7 @@ class ENHANCEDCODEFLOW_API UECFWaitAndExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Wait and Execute failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Wait and Execute failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } @@ -131,7 +131,7 @@ class ENHANCEDCODEFLOW_API UECFWaitAndExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Wait and Execute failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Wait and Execute failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } @@ -153,7 +153,7 @@ class ENHANCEDCODEFLOW_API UECFWaitAndExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Wait and Execute failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Wait and Execute failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } @@ -180,7 +180,7 @@ class ENHANCEDCODEFLOW_API UECFWaitAndExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - Wait and Execute failed to start. Are you sure the Function is set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] Wait and Execute failed to start. Are you sure the Function is set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWhileTrueExecute.h b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWhileTrueExecute.h index 88c2eb2..a8c6eef 100644 --- a/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWhileTrueExecute.h +++ b/Source/EnhancedCodeFlow/Public/CodeFlowActions/ECFWhileTrueExecute.h @@ -61,7 +61,7 @@ class ENHANCEDCODEFLOW_API UECFWhileTrueExecute : public UECFActionBase else { #if ECF_LOGS - UE_LOG(LogECF, Error, TEXT("ECF - While True Execute failed to start. Are you sure the Predicate and Function are set properly?")); + UE_LOG(LogECF, Error, TEXT("ECF - [%s] While True Execute failed to start. Are you sure the Predicate and Function are set properly?"), *Settings.Label); #endif return false; } diff --git a/Source/EnhancedCodeFlow/Public/ECFActionSettings.h b/Source/EnhancedCodeFlow/Public/ECFActionSettings.h index c62336e..071319f 100644 --- a/Source/EnhancedCodeFlow/Public/ECFActionSettings.h +++ b/Source/EnhancedCodeFlow/Public/ECFActionSettings.h @@ -15,19 +15,20 @@ struct ENHANCEDCODEFLOW_API FECFActionSettings FirstDelay(0.f), bIgnorePause(false), bIgnoreGlobalTimeDilation(false), - bStartPaused(false) + bStartPaused(false), + Label(TEXT("")) { } - FECFActionSettings(float InTickInterval, float InFirstDelay = 0.f, bool InIgnorePause = false, bool InIgnoreTimeDilation = false, bool InStartPaused = false) : + FECFActionSettings(float InTickInterval, float InFirstDelay = 0.f, bool InIgnorePause = false, bool InIgnoreTimeDilation = false, bool InStartPaused = false, const FString& InLabel = TEXT("")) : TickInterval(InTickInterval), FirstDelay(InFirstDelay), bIgnorePause(InIgnorePause), bIgnoreGlobalTimeDilation(InIgnoreTimeDilation), - bStartPaused(InStartPaused) + bStartPaused(InStartPaused), + Label(InLabel) { - } UPROPERTY(BlueprintReadWrite, Category = "ECF") @@ -44,11 +45,14 @@ struct ENHANCEDCODEFLOW_API FECFActionSettings UPROPERTY(BlueprintReadWrite, Category = "ECF") bool bStartPaused = false; + + UPROPERTY(BlueprintReadWrite, Category = "ECF") + FString Label; }; -#define ECF_TICKINTERVAL(_Interval) FECFActionSettings(_Interval, 0.f, false, false, false) -#define ECF_DELAYFIRST(_Delay) FECFActionSettings(0.f, _Delay, false, false, false) -#define ECF_IGNOREPAUSE FECFActionSettings(0.f, 0.f, true, false, false) -#define ECF_IGNORETIMEDILATION FECFActionSettings(0.f, 0.f, false, true, false) -#define ECF_IGNOREPAUSEDILATION FECFActionSettings(0.f, 0.f, true, true, false) -#define ECF_STARTPAUSED FECFActionSettings(0.f, 0.f, false, false, true) +#define ECF_TICKINTERVAL(_Interval) FECFActionSettings(_Interval, 0.f, false, false, false, TEXT("")) +#define ECF_DELAYFIRST(_Delay) FECFActionSettings(0.f, _Delay, false, false, false, TEXT("")) +#define ECF_IGNOREPAUSE FECFActionSettings(0.f, 0.f, true, false, false, TEXT("")) +#define ECF_IGNORETIMEDILATION FECFActionSettings(0.f, 0.f, false, true, false, TEXT("")) +#define ECF_IGNOREPAUSEDILATION FECFActionSettings(0.f, 0.f, true, true, false, TEXT("")) +#define ECF_STARTPAUSED FECFActionSettings(0.f, 0.f, false, false, true, TEXT("")) diff --git a/Source/EnhancedCodeFlow/Public/ECFSubsystem.h b/Source/EnhancedCodeFlow/Public/ECFSubsystem.h index e252066..2123883 100644 --- a/Source/EnhancedCodeFlow/Public/ECFSubsystem.h +++ b/Source/EnhancedCodeFlow/Public/ECFSubsystem.h @@ -126,6 +126,10 @@ class ENHANCEDCODEFLOW_API UECFSubsystem : public UGameInstanceSubsystem, public // Try to find running or pending action. UECFActionBase* FindAction(const FECFHandle& HandleId) const; + + // Finds the first running or pending action with the given Label and returns its FECFHandle. Returns invalid handle if not found. + FECFHandle FindActionByLabel(const FString& Label) const; + // Check if the action is running or pending to run. bool HasAction(const FECFHandle& HandleId) const;