From 4743e4e792a91eab856b69eb156334a0e58c944d Mon Sep 17 00:00:00 2001 From: MH261677 Date: Fri, 12 Jan 2024 15:38:25 +0000 Subject: [PATCH] Added Basic WeaponWorkbench Code --- .../FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset | 4 ++-- .../Workbench&Attachments/WeaponWorkbenchClass.cpp | 8 +++++--- .../Workbench&Attachments/WeaponWorkbenchClass.h | 6 ++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index ea9b685a..39194017 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58139ccad1a63dd9fa03404f0fb0b7af3f742d844b0ed7da0e081b96319600b9 -size 54773 +oid sha256:5eaca2e57e26f94e805c2ac2c43e5f48686cb60e923d4676b8a229ab1206d46f +size 54396 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset index adf7c5a3..b396c563 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04cfc7fe61d70436448fef9aab937104318ff0f55b78ff073901898ebba5427b -size 30633 +oid sha256:8d5cfa689a3e0540b6d9d02b7c7f52a810fc65740e4831b3fc1e97070cae84ff +size 40168 diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp index 7dda702e..5fbb7457 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp @@ -15,7 +15,7 @@ AWeaponWorkbenchClass::AWeaponWorkbenchClass() void AWeaponWorkbenchClass::BeginPlay() { Super::BeginPlay(); - + PlayerCharacterRef = Cast(GetWorld()->GetFirstPlayerController()->GetCharacter()); } // Called every frame @@ -26,11 +26,13 @@ void AWeaponWorkbenchClass::Tick(float DeltaTime) void AWeaponWorkbenchClass::Interact() { - UE_LOG(LogTemp, Display, TEXT("Interacted with weapon workbench")); + if (!PlayerCharacterRef->bHasRifle) return; + UE_LOG(LogTemp, Display, TEXT("Opening Workbench")); + WorkbenchUI(); } void AWeaponWorkbenchClass::InteractPrompt() { - + //THIS IS PROMPT WHERE WILL BE PRESS F TO INTERACT OR WHATEVER } diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h index 6cf64981..c1e54793 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" +#include "EndlessVendetta/EndlessVendettaCharacter.h" #include "EndlessVendetta/InteractionInterface.h" #include "GameFramework/Actor.h" #include "WeaponWorkbenchClass.generated.h" @@ -26,4 +27,9 @@ public: void Interact() override; void InteractPrompt() override; + + UFUNCTION(BlueprintImplementableEvent) + void WorkbenchUI(); + + AEndlessVendettaCharacter* PlayerCharacterRef; };