From 7176fb6d24084850fead9824f2f4128fb9c2e915 Mon Sep 17 00:00:00 2001 From: "adnan.mujkic" Date: Sat, 5 Sep 2026 00:15:50 +0200 Subject: [PATCH] Further fixes for interact system --- Config/DefaultGameplayTags.ini | 2 ++ Content/GameData/DA_BazaarSettings.uasset | 4 ++-- .../Scripts/Bazar/BP_BazarSellingStand.uasset | 4 ++-- .../Blueprints/BP_ThirdPersonCharacter.uasset | 4 ++-- .../Private/EleriPlayerController.cpp | 17 +++++++++++++---- Source/ProjectEleri/Private/MyCharacter.cpp | 11 ----------- Source/ProjectEleri/Public/MyCharacter.h | 3 --- 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Config/DefaultGameplayTags.ini b/Config/DefaultGameplayTags.ini index 571c725d..49fb9da7 100644 --- a/Config/DefaultGameplayTags.ini +++ b/Config/DefaultGameplayTags.ini @@ -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="") diff --git a/Content/GameData/DA_BazaarSettings.uasset b/Content/GameData/DA_BazaarSettings.uasset index 41f9121f..d61d70f0 100644 --- a/Content/GameData/DA_BazaarSettings.uasset +++ b/Content/GameData/DA_BazaarSettings.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5c97c8bb7c7ba5d7c9fd921697f2e8fe52e01aa6bdcfcd39257e66be59f00194 -size 21737 +oid sha256:c9bbab1c9adae1af2c7b93680ecfbf3636a9118843b7f24a1726fac73ff6e143 +size 25162 diff --git a/Content/Scripts/Bazar/BP_BazarSellingStand.uasset b/Content/Scripts/Bazar/BP_BazarSellingStand.uasset index e23b6515..141890de 100644 --- a/Content/Scripts/Bazar/BP_BazarSellingStand.uasset +++ b/Content/Scripts/Bazar/BP_BazarSellingStand.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61a88c6a43f5a9372211e63bda09dfceacc60b821926a9443835461847856fd0 -size 1242729 +oid sha256:c66af41589200b7ec964e6a37de290afc9abe7999873b45fec3a31fe671b1b41 +size 1241241 diff --git a/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset b/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset index fc4d5774..7b54544d 100644 --- a/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset +++ b/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3452b7042072a0b5f6da798550cfa33a77f6febabce9f3f87af6d51a4bfdc528 -size 1313759 +oid sha256:f6b88d82b7d94d14c336d2b6416ff71e111faad5d07e26b0912e5083ae14c23e +size 1301649 diff --git a/Source/ProjectEleri/Private/EleriPlayerController.cpp b/Source/ProjectEleri/Private/EleriPlayerController.cpp index 71cb26f1..5d27c9cb 100644 --- a/Source/ProjectEleri/Private/EleriPlayerController.cpp +++ b/Source/ProjectEleri/Private/EleriPlayerController.cpp @@ -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(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(); } diff --git a/Source/ProjectEleri/Private/MyCharacter.cpp b/Source/ProjectEleri/Private/MyCharacter.cpp index 1e034085..645ed813 100644 --- a/Source/ProjectEleri/Private/MyCharacter.cpp +++ b/Source/ProjectEleri/Private/MyCharacter.cpp @@ -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(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(TEXT("StatForgeComponent")); } @@ -64,11 +58,6 @@ void AMyCharacter::BeginPlay() PlayerController = Cast(UGameplayStatics::GetPlayerController(GetWorld(), 0)); } - if (IsValid(InteractableOverlapMesh)) { - InteractableOverlapMesh->OnComponentBeginOverlap.AddDynamic(this, &AMyCharacter::OnEnteredInteractableObject); - InteractableOverlapMesh->OnComponentEndOverlap.AddDynamic(this, &AMyCharacter::OnLeftInteractableObject); - } - CameraRef = GetComponentByClass(); SpringArmRef = GetComponentByClass(); PlayerController->SetViewTarget(this); diff --git a/Source/ProjectEleri/Public/MyCharacter.h b/Source/ProjectEleri/Public/MyCharacter.h index 61e354c7..e0596c72 100644 --- a/Source/ProjectEleri/Public/MyCharacter.h +++ b/Source/ProjectEleri/Public/MyCharacter.h @@ -43,9 +43,6 @@ protected: UPROPERTY() ABookActor* BookActor; - UPROPERTY(EditAnywhere) - UBoxComponent* InteractableOverlapMesh; - UPROPERTY() AEleriPlayerController* PlayerController; UPROPERTY()