|
|
|
|
| #pragma once
|
|
|
| #include "CoreMinimal.h"
|
| #include "Abilities/GameplayAbility.h"
|
| #include "InteractionOption.generated.h"
|
|
|
| class IInteractableTarget;
|
| class UUserWidget;
|
|
|
|
|
| USTRUCT(BlueprintType)
|
| struct FInteractionOption
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
|
|
| UPROPERTY(BlueprintReadWrite)
|
| TScriptInterface<IInteractableTarget> InteractableTarget;
|
|
|
|
|
| UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
| FText Text;
|
|
|
|
|
| UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
| FText SubText;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
| TSubclassOf<UGameplayAbility> InteractionAbilityToGrant;
|
|
|
|
|
|
|
|
|
|
|
|
|
| UPROPERTY(BlueprintReadOnly)
|
| TObjectPtr<UAbilitySystemComponent> TargetAbilitySystem = nullptr;
|
|
|
|
|
| UPROPERTY(BlueprintReadOnly)
|
| FGameplayAbilitySpecHandle TargetInteractionAbilityHandle;
|
|
|
|
|
|
|
|
|
|
|
| UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
| TSoftClassPtr<UUserWidget> InteractionWidgetClass;
|
|
|
|
|
|
|
| public:
|
| FORCEINLINE bool operator==(const FInteractionOption& Other) const
|
| {
|
| return InteractableTarget == Other.InteractableTarget &&
|
| InteractionAbilityToGrant == Other.InteractionAbilityToGrant&&
|
| TargetAbilitySystem == Other.TargetAbilitySystem &&
|
| TargetInteractionAbilityHandle == Other.TargetInteractionAbilityHandle &&
|
| InteractionWidgetClass == Other.InteractionWidgetClass &&
|
| Text.IdenticalTo(Other.Text) &&
|
| SubText.IdenticalTo(Other.SubText);
|
| }
|
|
|
| FORCEINLINE bool operator!=(const FInteractionOption& Other) const
|
| {
|
| return !operator==(Other);
|
| }
|
|
|
| FORCEINLINE bool operator<(const FInteractionOption& Other) const
|
| {
|
| return InteractableTarget.GetInterface() < Other.InteractableTarget.GetInterface();
|
| }
|
| };
|
|
|