Skip to content

Commit 54ed586

Browse files
Made FKey input optional
1 parent e4d09ce commit 54ed586

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void UActorInteractorComponentBase::EvaluateInteractable(const TScriptInterface<
152152
}
153153
}
154154

155-
void UActorInteractorComponentBase::StartInteraction(const float StartTime, const FKey& InputKey)
155+
void UActorInteractorComponentBase::StartInteraction(const float StartTime, FKey InputKey)
156156
{
157157
if (CanInteract() && ActiveInteractable.GetInterface())
158158
{
@@ -161,7 +161,7 @@ void UActorInteractorComponentBase::StartInteraction(const float StartTime, cons
161161
}
162162
}
163163

164-
void UActorInteractorComponentBase::StopInteraction(const float StartTime, const FKey& InputKey)
164+
void UActorInteractorComponentBase::StopInteraction(const float StartTime, FKey InputKey)
165165
{
166166
if (CanInteract() && ActiveInteractable.GetInterface())
167167
{

Source/ActorInteractionPlugin/Public/Components/ActorInteractorComponentBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractorComponentBase : public UActorCo
103103
* @param InputKey Optional Key. Some Interactions might require this value to perform checks.
104104
*/
105105
UFUNCTION(BlueprintCallable, Category="Interaction")
106-
virtual void StartInteraction(const float StartTime, const FKey& InputKey) override;
106+
virtual void StartInteraction(const float StartTime, FKey InputKey) override;
107107
/**
108108
* Function to stop interaction.
109109
* No conditions required.
110110
*/
111111
UFUNCTION(BlueprintCallable, Category="Interaction")
112-
virtual void StopInteraction(const float StartTime, const FKey& InputKey) override;
112+
virtual void StopInteraction(const float StartTime, FKey InputKey) override;
113113

114114

115115
/**

Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractorInterface.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableSelected, const TScript
2020
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableFound, const TScriptInterface<IActorInteractableInterface>&, FoundInteractable);
2121
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableLost, const TScriptInterface<IActorInteractableInterface>&, LostInteractable);
2222

23-
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyPressed, const float&, TimeKeyPressed, const FKey&, PressedKey);
24-
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyReleased, const float&, TimeKeyReleased, const FKey&, ReleasedKey);
23+
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyPressed, const float&, TimeKeyPressed, FKey, PressedKey);
24+
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyReleased, const float&, TimeKeyReleased, FKey, ReleasedKey);
2525

2626
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FIgnoredActorAdded, const AActor*, AddedActor);
2727
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FIgnoredActorRemoved, const AActor*, RemovedActor);
@@ -80,7 +80,7 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractorInterface
8080
* @param PressedKey Key which was pressed
8181
*/
8282
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Interaction")
83-
void OnInteractionKeyPressedEvent(const float& TimeKeyPressed, const FKey& PressedKey);
83+
void OnInteractionKeyPressedEvent(const float& TimeKeyPressed, FKey PressedKey);
8484
void OnInteractionKeyPressedEvent_Implementation(const float& TimeKeyPressed, const FKey& PressedKey)
8585
{
8686
StartInteraction(TimeKeyPressed, PressedKey);
@@ -95,7 +95,7 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractorInterface
9595
* @param ReleasedKey Key which was released
9696
*/
9797
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Interaction")
98-
void OnInteractionKeyReleasedEvent(const float& TimeKeyReleased, const FKey& ReleasedKey);
98+
void OnInteractionKeyReleasedEvent(const float& TimeKeyReleased, FKey ReleasedKey);
9999
void OnInteractionKeyReleasedEvent_Implementation(const float& TimeKeyReleased, const FKey& ReleasedKey)
100100
{
101101
StopInteraction(TimeKeyReleased, ReleasedKey);
@@ -158,8 +158,8 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractorInterface
158158

159159
virtual bool IsValidInteractor() const = 0;
160160

161-
virtual void StartInteraction(const float StartTime, const FKey& InputKey) = 0;
162-
virtual void StopInteraction(const float StartTime, const FKey& InputKey) = 0;
161+
virtual void StartInteraction(const float StartTime, FKey InputKey) = 0;
162+
virtual void StopInteraction(const float StartTime, FKey InputKey) = 0;
163163

164164
virtual bool ActivateInteractor(FString& ErrorMessage) = 0;
165165
virtual bool WakeUpInteractor(FString& ErrorMessage) = 0;

0 commit comments

Comments
 (0)