Further fixes for interact system
This commit is contained in:
@@ -59,5 +59,7 @@ NetIndexFirstBitSegment=16
|
|||||||
+GameplayTagList=(Tag="Skins.Eleri.Default",DevComment="")
|
+GameplayTagList=(Tag="Skins.Eleri.Default",DevComment="")
|
||||||
+GameplayTagList=(Tag="Skins.Eleri.DefaultNoHat",DevComment="")
|
+GameplayTagList=(Tag="Skins.Eleri.DefaultNoHat",DevComment="")
|
||||||
+GameplayTagList=(Tag="Upgrade.Bazaar",DevComment="")
|
+GameplayTagList=(Tag="Upgrade.Bazaar",DevComment="")
|
||||||
|
+GameplayTagList=(Tag="Upgrade.Bazaar.BetterEmotions",DevComment="")
|
||||||
+GameplayTagList=(Tag="Upgrade.Bazaar.Capacity",DevComment="")
|
+GameplayTagList=(Tag="Upgrade.Bazaar.Capacity",DevComment="")
|
||||||
|
+GameplayTagList=(Tag="Upgrade.Bazaar.MoreCustomers",DevComment="")
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,6 +20,8 @@
|
|||||||
#include "UI/TradeWidget.h"
|
#include "UI/TradeWidget.h"
|
||||||
#include "ProjectEleri/Public/UI/SelectionManager.h"
|
#include "ProjectEleri/Public/UI/SelectionManager.h"
|
||||||
#include "ProjectEleri/DialogueSystem/DialogueWidget.h"
|
#include "ProjectEleri/DialogueSystem/DialogueWidget.h"
|
||||||
|
#include "Subsystem/InteractionSubsystem.h"
|
||||||
|
#include "Interface/InteractableActorInterface.h"
|
||||||
|
|
||||||
AEleriPlayerController::AEleriPlayerController(const FObjectInitializer &ObjectInitializer)
|
AEleriPlayerController::AEleriPlayerController(const FObjectInitializer &ObjectInitializer)
|
||||||
: Super(ObjectInitializer)
|
: Super(ObjectInitializer)
|
||||||
@@ -741,10 +743,10 @@ void AEleriPlayerController::ToggleInteractionMenu(bool bActive)
|
|||||||
}
|
}
|
||||||
if (UEnhancedInputLocalPlayerSubsystem *Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
|
if (UEnhancedInputLocalPlayerSubsystem *Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
|
||||||
{
|
{
|
||||||
if (bActive)
|
// if (bActive)
|
||||||
Subsystem->AddMappingContext(InteractionMenuContext, 15);
|
// Subsystem->AddMappingContext(InteractionMenuContext, 15);
|
||||||
else
|
// else
|
||||||
Subsystem->RemoveMappingContext(InteractionMenuContext);
|
// Subsystem->RemoveMappingContext(InteractionMenuContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1151,6 +1153,13 @@ void AEleriPlayerController::OnInteract(const FInputActionValue &Value)
|
|||||||
if (PlayerCharacter->GetIsPlanting())
|
if (PlayerCharacter->GetIsPlanting())
|
||||||
PlayerCharacter->PlantSeed();
|
PlayerCharacter->PlantSeed();
|
||||||
|
|
||||||
|
// Ask the InteractionSystem plugin's subsystem for the closest valid interactable
|
||||||
|
// and fire the interaction on it if we have one.
|
||||||
|
if (AActor *ClosestInteractable = UInteractionSubsystem::GetClosestInteractable(this))
|
||||||
|
{
|
||||||
|
IInteractableActorInterface::Execute_Interact(ClosestInteractable, PlayerCharacter);
|
||||||
|
}
|
||||||
|
|
||||||
PlayerCharacter->OnInteract.Broadcast();
|
PlayerCharacter->OnInteract.Broadcast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,12 +34,6 @@ AMyCharacter::AMyCharacter()
|
|||||||
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
PrimaryActorTick.bCanEverTick = true;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
InteractableOverlapMesh = CreateDefaultSubobject<UBoxComponent>(FName("Box Collision"));
|
|
||||||
InteractableOverlapMesh->SetupAttachment(RootComponent);
|
|
||||||
InteractableOverlapMesh->SetRelativeLocation(FVector(0.0f, 0.0f, 33.33f));
|
|
||||||
InteractableOverlapMesh->SetRelativeScale3D(FVector(2.0f, 2.0f, 4.0f));
|
|
||||||
InteractableOverlapMesh->SetGenerateOverlapEvents(true);
|
|
||||||
|
|
||||||
StatForgeComponent = CreateDefaultSubobject<UStatForgeComponent>(TEXT("StatForgeComponent"));
|
StatForgeComponent = CreateDefaultSubobject<UStatForgeComponent>(TEXT("StatForgeComponent"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,11 +58,6 @@ void AMyCharacter::BeginPlay()
|
|||||||
PlayerController = Cast<AEleriPlayerController>(UGameplayStatics::GetPlayerController(GetWorld(), 0));
|
PlayerController = Cast<AEleriPlayerController>(UGameplayStatics::GetPlayerController(GetWorld(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsValid(InteractableOverlapMesh)) {
|
|
||||||
InteractableOverlapMesh->OnComponentBeginOverlap.AddDynamic(this, &AMyCharacter::OnEnteredInteractableObject);
|
|
||||||
InteractableOverlapMesh->OnComponentEndOverlap.AddDynamic(this, &AMyCharacter::OnLeftInteractableObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
CameraRef = GetComponentByClass<UCameraComponent>();
|
CameraRef = GetComponentByClass<UCameraComponent>();
|
||||||
SpringArmRef = GetComponentByClass<USpringArmComponent>();
|
SpringArmRef = GetComponentByClass<USpringArmComponent>();
|
||||||
PlayerController->SetViewTarget(this);
|
PlayerController->SetViewTarget(this);
|
||||||
|
|||||||
@@ -43,9 +43,6 @@ protected:
|
|||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
ABookActor* BookActor;
|
ABookActor* BookActor;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
|
||||||
UBoxComponent* InteractableOverlapMesh;
|
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
AEleriPlayerController* PlayerController;
|
AEleriPlayerController* PlayerController;
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
|
|||||||
Reference in New Issue
Block a user