major inventory system scripting job done, now onto creating blueprints, input action, and working on the GUI

This commit is contained in:
Ji Yoon Rhee
2024-01-01 21:54:48 +09:00
parent b7a583ab27
commit 76d375aae5
185 changed files with 13794 additions and 71201 deletions

View File

@ -11,17 +11,14 @@ AHYInteractableActor::AHYInteractableActor()
}
void AHYInteractableActor::Interact(APlayerController* Controller)
{
}
void AHYInteractableActor::Interact_Implementation(APlayerController* Controller)
{
return;
}
FString AHYInteractableActor::GetInteractText() const
{
return FString();
return FString::Printf(TEXT("s%: Press F to %s"), *Name, *Action);
}
// Called when the game starts or when spawned

View File

@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "HYManualPickUp.h"
#include "HYPlayerCharacController.h"
AHYManualPickUp::AHYManualPickUp()
{
PickUpRangeMesh = CreateDefaultSubobject<UStaticMeshComponent>("PickupMesh");
RootComponent = Cast<USceneComponent>(PickUpRangeMesh);
ItemID = FName("No ID");
Super::Name = "Item";
Super::Action = "pickup";
}
void AHYManualPickUp::Interact_Implementation(APlayerController* Controller)
{
Super::Interact_Implementation(Controller);
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(Controller);
if (IController->AddItemToInventoryByID(ItemID))
Destroy();
}

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "HYInteractableActor.h"
#include "HYManualPickUp.generated.h"
/**
*
*/
UCLASS()
class HWANYOUNG2_API AHYManualPickUp : public AHYInteractableActor
{
GENERATED_BODY()
public:
AHYManualPickUp();
void Interact_Implementation(APlayerController* Controller) override;
protected:
UPROPERTY(EditAnywhere)
UStaticMeshComponent* PickUpRangeMesh;
UPROPERTY(EditAnywhere,BlueprintReadWrite)
FName ItemID;
};

View File

@ -12,11 +12,6 @@ AHYPlayerCharacController::AHYPlayerCharacController()
InventoryWeightLimit = 500;
}
void AHYPlayerCharacController::ReloadInventory()
{
}
int32 AHYPlayerCharacController::GetInventoryWeight()
{
int32 TotalWeight = 0;

View File

@ -5,7 +5,7 @@
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Engine/DataTable.h"
//#include "InventoryItem.generated.h"
#include "InventoryItem.generated.h"
/**
*

View File

@ -198,9 +198,6 @@ protected:
// To add mapping context
virtual void BeginPlay();
// Checks for the closest Interactable in sight and in range
void CheckForInteractables();
};