idk if i'm doing this correctly bro please help me lord

This commit is contained in:
Ji Yoon Rhee
2023-12-25 16:47:15 +09:00
parent 36bcb08c75
commit 6235bcb85c
49 changed files with 4404 additions and 1964 deletions

View File

@ -11,6 +11,14 @@ AHYInteractableActor::AHYInteractableActor()
}
void AHYInteractableActor::Interact(APlayerController* Controller)
{
}
void AHYInteractableActor::Interact_Implementation(APlayerController* Controller)
{
}
// Called when the game starts or when spawned
void AHYInteractableActor::BeginPlay()
{

View File

@ -3,6 +3,24 @@
#include "HYPlayerCharacController.h"
AHYPlayerCharacController::AHYPlayerCharacController()
{
}
void AHYPlayerCharacController::ReloadInventory()
{
}
int32 AHYPlayerCharacController::GetInventoryWeight()
{
return int32();
}
bool AHYPlayerCharacController::AddItemToInventoryByID(FName ID)
{
return false;
}
void AHYPlayerCharacController::OnPossess(APawn* InPawn)
{

View File

@ -2,7 +2,8 @@
#pragma once
#include "Interactable.h"
#include "HYInteractableActor.h"
#include "InventoryItem.h"
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
@ -16,6 +17,39 @@ class HWANYOUNG2_API AHYPlayerCharacController : public APlayerController
{
GENERATED_BODY()
public:
#pragma region inventory
AHYPlayerCharacController();
UFUNCTION(BlueprintImplementableEvent)
void ReloadInventory();
UFUNCTION(BlueprintCallable, Category = "Utils")
int32 GetInventoryWeight();
UFUNCTION(BlueprintCallable, Category = "Utils")
bool AddItemToInventoryByID(FName ID);
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
class AHYInteractableActor* CurrentInteractable;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
TArray<FInventoryItem> Inventory;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 InventorySlotLimit;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 InventoryWeightLimit;
#pragma endregion
protected:
void Interact();
virtual void SetupInputComponent() override;
virtual void OnPossess(APawn* InPawn) override;
};

View File

@ -0,0 +1,6 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "InventoryItem.h"

View File

@ -0,0 +1,19 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Engine/DataTable.h"
//#include "InventoryItem.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FInventoryItem : public FTableRowBase
{
//GENERATED_USTRUCT_BODY();
public:
FInventoryItem();
};

View File

@ -186,7 +186,7 @@ void Ahwanyoung2Character::CheckForInteractables()
ECC_Visibility, QueryParams)) {
//Cast the actor to AInteractable
AInteractable* Interactable = Cast<AInteractable>(HitResult.GetActor());
AHYInteractableActor* Interactable = Cast<AHYInteractableActor>(HitResult.GetActor());
if (Interactable) {
IController->CurrentInteractable = Interactable;