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.DefaultNoHat",DevComment="")
|
||||
+GameplayTagList=(Tag="Upgrade.Bazaar",DevComment="")
|
||||
+GameplayTagList=(Tag="Upgrade.Bazaar.BetterEmotions",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 "ProjectEleri/Public/UI/SelectionManager.h"
|
||||
#include "ProjectEleri/DialogueSystem/DialogueWidget.h"
|
||||
#include "Subsystem/InteractionSubsystem.h"
|
||||
#include "Interface/InteractableActorInterface.h"
|
||||
|
||||
AEleriPlayerController::AEleriPlayerController(const FObjectInitializer &ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
@@ -741,10 +743,10 @@ void AEleriPlayerController::ToggleInteractionMenu(bool bActive)
|
||||
}
|
||||
if (UEnhancedInputLocalPlayerSubsystem *Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
|
||||
{
|
||||
if (bActive)
|
||||
Subsystem->AddMappingContext(InteractionMenuContext, 15);
|
||||
else
|
||||
Subsystem->RemoveMappingContext(InteractionMenuContext);
|
||||
// if (bActive)
|
||||
// Subsystem->AddMappingContext(InteractionMenuContext, 15);
|
||||
// else
|
||||
// Subsystem->RemoveMappingContext(InteractionMenuContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1151,6 +1153,13 @@ void AEleriPlayerController::OnInteract(const FInputActionValue &Value)
|
||||
if (PlayerCharacter->GetIsPlanting())
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
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"));
|
||||
}
|
||||
|
||||
@@ -64,11 +58,6 @@ void AMyCharacter::BeginPlay()
|
||||
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>();
|
||||
SpringArmRef = GetComponentByClass<USpringArmComponent>();
|
||||
PlayerController->SetViewTarget(this);
|
||||
|
||||
@@ -43,9 +43,6 @@ protected:
|
||||
UPROPERTY()
|
||||
ABookActor* BookActor;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
UBoxComponent* InteractableOverlapMesh;
|
||||
|
||||
UPROPERTY()
|
||||
AEleriPlayerController* PlayerController;
|
||||
UPROPERTY()
|
||||
|
||||
Reference in New Issue
Block a user