From 23d4287183eb4085e9e24dd4722399f3c9d4b601 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 10 Oct 2023 17:22:10 +0200 Subject: [PATCH] change the ufunction specifier for sgpawn blueprint implementable events to blueprint native event in order to allow overrides from c++ as well --- CHANGELOG.md | 4 ++++ .../SenseGlove/GameFramework/SGPawn.cpp | 24 +++++++++++++++++++ .../Public/SenseGlove/GameFramework/SGPawn.h | 12 +++++----- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18918caa..9555b0c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- The BlueprintImplementableEvent have been changed to BlueprintNativeEvent in order to allow them to be implemented from the child C++ classes as well. This won't break any existing Blueprint code that relies on the previous BlueprintImplementableEvent signature. + ### Fixed - Add a missing release note entry for the v1.8.0 release to the changelog file. diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index f61b1a66..f428b655 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -613,6 +613,30 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer) RightHandTouchState = FSGTouchState(HandRight, nullptr, nullptr, nullptr, nullptr, nullptr); } +void ASGPawn::OnGrabStateUpdated_Implementation(const FSGGrabState& GrabState) +{ +} + +void ASGPawn::OnTouchStateUpdated_Implementation(const FSGTouchState& TouchState) +{ +} + +void ASGPawn::OnActorGrabbed_Implementation(const USGVirtualHandComponent* Hand, const AActor* Actor) +{ +} + +void ASGPawn::OnActorReleased_Implementation(const USGVirtualHandComponent* Hand, const AActor* Actor) +{ +} + +void ASGPawn::OnActorBeginTouch_Implementation(const USGVirtualHandComponent* Hand, const AActor* Actor) +{ +} + +void ASGPawn::OnActorEndTouch_Implementation(const USGVirtualHandComponent* Hand, const AActor* Actor) +{ +} + void ASGPawn::BeginPlay() { Super::BeginPlay(); diff --git a/Source/SenseGlove/Public/SenseGlove/GameFramework/SGPawn.h b/Source/SenseGlove/Public/SenseGlove/GameFramework/SGPawn.h index 22c50acb..abd0e3d9 100644 --- a/Source/SenseGlove/Public/SenseGlove/GameFramework/SGPawn.h +++ b/Source/SenseGlove/Public/SenseGlove/GameFramework/SGPawn.h @@ -215,22 +215,22 @@ private: TArray RightHandOverlappedActors; protected: - UFUNCTION(BlueprintImplementableEvent, Category="SenseGlove | Game Framework | Pawn") + UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn") void OnGrabStateUpdated(const FSGGrabState& GrabState); - UFUNCTION(BlueprintImplementableEvent, Category="SenseGlove | Game Framework | Pawn") + UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn") void OnTouchStateUpdated(const FSGTouchState& TouchState); - UFUNCTION(BlueprintImplementableEvent, Category="SenseGlove | Game Framework | Pawn") + UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn") void OnActorGrabbed(const USGVirtualHandComponent* Hand, const AActor* Actor); - UFUNCTION(BlueprintImplementableEvent, Category="SenseGlove | Game Framework | Pawn") + UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn") void OnActorReleased(const USGVirtualHandComponent* Hand, const AActor* Actor); - UFUNCTION(BlueprintImplementableEvent, Category="SenseGlove | Game Framework | Pawn") + UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn") void OnActorBeginTouch(const USGVirtualHandComponent* Hand, const AActor* Actor); - UFUNCTION(BlueprintImplementableEvent, Category="SenseGlove | Game Framework | Pawn") + UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn") void OnActorEndTouch(const USGVirtualHandComponent* Hand, const AActor* Actor); public: