Skip to content
Snippets Groups Projects
Commit b9bb8062 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Merge remote-tracking branch 'remotes/upstream/dev/5.3' into refactor/plugin_separation

# Conflicts:
#	Source/RWTHVRToolkit/Private/Utility/RWTHVRUtilities.cpp
#	Source/RWTHVRToolkit/Public/Utility/RWTHVRUtilities.h
parents f7f383e3 53c84a3f
No related branches found
No related tags found
2 merge requests!85UE5.3-2023.1-rc3,!79Plugin Separation: Move the RWTHVRCluster Module into its own Plugin with respective content. Removes Toolkit dependency to nDisplay
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
#include "Interaction/Interactables/IntenSelect/IntenSelectableScoring.h" #include "Interaction/Interactables/IntenSelect/IntenSelectableScoring.h"
#include "Interaction/Interactables/IntenSelect/IntenSelectableSinglePointScoring.h" #include "Interaction/Interactables/IntenSelect/IntenSelectableSinglePointScoring.h"
#include "Kismet/KismetSystemLibrary.h" #include "Kismet/KismetSystemLibrary.h"
#include "Logging/StructuredLog.h"
#include "Misc/MessageDialog.h" #include "Misc/MessageDialog.h"
#include "Pawn/IntenSelectComponent.h" #include "Pawn/IntenSelectComponent.h"
#include "Utility/RWTHVRUtilities.h"
UIntenSelectable::UIntenSelectable() { PrimaryComponentTick.bCanEverTick = true; } UIntenSelectable::UIntenSelectable() { PrimaryComponentTick.bCanEverTick = true; }
...@@ -45,7 +47,8 @@ void UIntenSelectable::BeginPlay() ...@@ -45,7 +47,8 @@ void UIntenSelectable::BeginPlay()
{ {
if (ScoringBehaviours.Num() == 0) if (ScoringBehaviours.Num() == 0)
{ {
ShowErrorAndQuit( UE_LOGFMT(
Toolkit, Error,
"Please assign the Scoring Behaviour manually when using more than one IntenSelectable Component!"); "Please assign the Scoring Behaviour manually when using more than one IntenSelectable Component!");
} }
} }
...@@ -57,36 +60,36 @@ void UIntenSelectable::BeginPlay() ...@@ -57,36 +60,36 @@ void UIntenSelectable::BeginPlay()
void UIntenSelectable::HandleOnSelectStartEvents(const UIntenSelectComponent* IntenSelect, const FHitResult& HitResult) void UIntenSelectable::HandleOnSelectStartEvents(const UIntenSelectComponent* IntenSelect, const FHitResult& HitResult)
{ {
for (const UHoverBehaviour* b : OnSelectBehaviours) for (const UHoverBehaviour* CurrentHoverBehaviour : OnHoverBehaviours)
{ {
b->OnHoverStartEvent.Broadcast(IntenSelect, HitResult); CurrentHoverBehaviour->OnHoverStartEvent.Broadcast(IntenSelect, HitResult);
} }
} }
void UIntenSelectable::HandleOnSelectEndEvents(const UIntenSelectComponent* IntenSelect) void UIntenSelectable::HandleOnSelectEndEvents(const UIntenSelectComponent* IntenSelect)
{ {
for (const UHoverBehaviour* b : OnSelectBehaviours) for (const UHoverBehaviour* CurrentHoverBehaviour : OnHoverBehaviours)
{ {
b->OnHoverEndEvent.Broadcast(IntenSelect); CurrentHoverBehaviour->OnHoverEndEvent.Broadcast(IntenSelect);
} }
} }
void UIntenSelectable::HandleOnClickStartEvents(UIntenSelectComponent* IntenSelect) void UIntenSelectable::HandleOnClickStartEvents(UIntenSelectComponent* IntenSelect)
{ {
for (const UActionBehaviour* b : OnClickBehaviours) for (const UActionBehaviour* CurrentActionBehaviour : OnActionBehaviours)
{ {
FInputActionValue v{}; FInputActionValue EmptyInputActionValue{};
const UInputAction* a{}; const UInputAction* EmptyInputAction{};
b->OnActionBeginEvent.Broadcast(IntenSelect, a, v); CurrentActionBehaviour->OnActionBeginEvent.Broadcast(IntenSelect, EmptyInputAction, EmptyInputActionValue);
} }
} }
void UIntenSelectable::HandleOnClickEndEvents(UIntenSelectComponent* IntenSelect, FInputActionValue& InputValue) void UIntenSelectable::HandleOnClickEndEvents(UIntenSelectComponent* IntenSelect, FInputActionValue& InputValue)
{ {
for (const UActionBehaviour* b : OnClickBehaviours) for (const UActionBehaviour* CurrentActionBehaviour : OnActionBehaviours)
{ {
const UInputAction* a{}; const UInputAction* EmptyInputActionValue{};
b->OnActionEndEvent.Broadcast(IntenSelect, a, InputValue); CurrentActionBehaviour->OnActionEndEvent.Broadcast(IntenSelect, EmptyInputActionValue, InputValue);
} }
} }
...@@ -114,23 +117,14 @@ void UIntenSelectable::InitDefaultBehaviourReferences() ...@@ -114,23 +117,14 @@ void UIntenSelectable::InitDefaultBehaviourReferences()
} }
// Selecting // Selecting
TInlineComponentArray<UHoverBehaviour*> AttachedSelectionBehaviours; TInlineComponentArray<UHoverBehaviour*> AttachedHoverBehaviours;
GetOwner()->GetComponents(AttachedSelectionBehaviours, true); GetOwner()->GetComponents(AttachedHoverBehaviours, true);
this->OnSelectBehaviours = AttachedSelectionBehaviours; OnHoverBehaviours = AttachedHoverBehaviours;
// Clicking // Clicking
TInlineComponentArray<UActionBehaviour*> AttachedClickBehaviours; TInlineComponentArray<UActionBehaviour*> AttachedClickBehaviours;
GetOwner()->GetComponents(AttachedClickBehaviours, true); GetOwner()->GetComponents(AttachedClickBehaviours, true);
this->OnClickBehaviours = AttachedClickBehaviours; OnActionBehaviours = AttachedClickBehaviours;
}
void UIntenSelectable::ShowErrorAndQuit(const FString& Message) const
{
UE_LOG(LogTemp, Error, TEXT("%s"), *Message)
#if WITH_EDITOR
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(FString("RUNTIME ERROR")));
#endif
UKismetSystemLibrary::QuitGame(this, nullptr, EQuitPreference::Quit, false);
} }
\ No newline at end of file
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
DEFINE_LOG_CATEGORY(Toolkit); DEFINE_LOG_CATEGORY(Toolkit);
bool URWTHVRUtilities::IsDesktopMode() bool URWTHVRUtilities::IsDesktopMode() { return !IsRoomMountedMode() && !IsHeadMountedMode(); }
{
return !IsRoomMountedMode() && !IsHeadMountedMode();
}
bool URWTHVRUtilities::IsHeadMountedMode() bool URWTHVRUtilities::IsHeadMountedMode()
{ {
......
...@@ -28,10 +28,10 @@ public: ...@@ -28,10 +28,10 @@ public:
TArray<UIntenSelectableScoring*> ScoringBehaviours; TArray<UIntenSelectableScoring*> ScoringBehaviours;
UPROPERTY(EditAnywhere, BlueprintReadWrite) UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<UHoverBehaviour*> OnSelectBehaviours; TArray<UHoverBehaviour*> OnHoverBehaviours;
UPROPERTY(EditAnywhere, BlueprintReadWrite) UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<UActionBehaviour*> OnClickBehaviours; TArray<UActionBehaviour*> OnActionBehaviours;
public: public:
...@@ -48,8 +48,6 @@ public: ...@@ -48,8 +48,6 @@ public:
void InitDefaultBehaviourReferences(); void InitDefaultBehaviourReferences();
void ShowErrorAndQuit(const FString& Message) const;
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment