diff --git a/Unreal 5.0/Content/SmartFactoryBP/BP_AnimalIncubator.uasset b/Unreal 5.0/Content/SmartFactoryBP/BP_AnimalIncubator.uasset index fe36bc6..9372fce 100644 Binary files a/Unreal 5.0/Content/SmartFactoryBP/BP_AnimalIncubator.uasset and b/Unreal 5.0/Content/SmartFactoryBP/BP_AnimalIncubator.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/BP_PlantIncubator.uasset b/Unreal 5.0/Content/SmartFactoryBP/BP_PlantIncubator.uasset index d18034d..620059e 100644 Binary files a/Unreal 5.0/Content/SmartFactoryBP/BP_PlantIncubator.uasset and b/Unreal 5.0/Content/SmartFactoryBP/BP_PlantIncubator.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/BP_PlayerCharacter.uasset b/Unreal 5.0/Content/SmartFactoryBP/BP_PlayerCharacter.uasset index 37fc796..8af3500 100644 Binary files a/Unreal 5.0/Content/SmartFactoryBP/BP_PlayerCharacter.uasset and b/Unreal 5.0/Content/SmartFactoryBP/BP_PlayerCharacter.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/CommodityTable.uasset b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/CommodityTable.uasset deleted file mode 100644 index ffa2c2e..0000000 Binary files a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/CommodityTable.uasset and /dev/null differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/Plant/Amaryllis/BP_CO_Amaryllis.uasset b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/Plant/Amaryllis/BP_CO_Amaryllis.uasset index c26a58c..f33d0eb 100644 Binary files a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/Plant/Amaryllis/BP_CO_Amaryllis.uasset and b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/Plant/Amaryllis/BP_CO_Amaryllis.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/PlantTable.uasset b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/PlantTable.uasset new file mode 100644 index 0000000..2012b15 Binary files /dev/null and b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/PlantTable.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/PlantTables.uasset b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/PlantTables.uasset new file mode 100644 index 0000000..831c7d6 Binary files /dev/null and b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/PlantTables.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/ProductTable.uasset b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/ProductTable.uasset new file mode 100644 index 0000000..3b3f8b4 Binary files /dev/null and b/Unreal 5.0/Content/SmartFactoryBP/HoldableObjects/ProductTable.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_3DPanel_UMG.uasset b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_3DPanel_UMG.uasset index 7e2fc32..1c75977 100644 Binary files a/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_3DPanel_UMG.uasset and b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_3DPanel_UMG.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Market.uasset b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Market.uasset new file mode 100644 index 0000000..04efa88 Binary files /dev/null and b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Market.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Market_Row.uasset b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Market_Row.uasset new file mode 100644 index 0000000..710b0c5 Binary files /dev/null and b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Market_Row.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Screen.uasset b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Screen.uasset new file mode 100644 index 0000000..feb5803 Binary files /dev/null and b/Unreal 5.0/Content/SmartFactoryBP/Panel/BP_PA_Screen.uasset differ diff --git a/Unreal 5.0/Content/SmartFactoryBP/SmartFactoryMap.umap b/Unreal 5.0/Content/SmartFactoryBP/SmartFactoryMap.umap index a82c226..c7901cb 100644 Binary files a/Unreal 5.0/Content/SmartFactoryBP/SmartFactoryMap.umap and b/Unreal 5.0/Content/SmartFactoryBP/SmartFactoryMap.umap differ diff --git a/Unreal 5.0/Source/Unreal/DataTableRow.cpp b/Unreal 5.0/Source/Unreal/DataTableRow.cpp index c36b401..fcc2fba 100644 --- a/Unreal 5.0/Source/Unreal/DataTableRow.cpp +++ b/Unreal 5.0/Source/Unreal/DataTableRow.cpp @@ -1,12 +1,3 @@ // Fill out your copyright notice in the Description page of Project Settings. - #include "DataTableRow.h" - -// Sets default values -ADataTableRow::ADataTableRow() -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - PrimaryActorTick.bCanEverTick = true; - -} diff --git a/Unreal 5.0/Source/Unreal/DataTableRow.h b/Unreal 5.0/Source/Unreal/DataTableRow.h index 86feb69..c0bbb55 100644 --- a/Unreal 5.0/Source/Unreal/DataTableRow.h +++ b/Unreal 5.0/Source/Unreal/DataTableRow.h @@ -13,7 +13,7 @@ * */ USTRUCT(BlueprintType) -struct FCommodityRow : public FTableRowBase +struct FProductRow : public FTableRowBase { GENERATED_BODY() @@ -28,13 +28,24 @@ struct FCommodityRow : public FTableRowBase UStaticMesh* FinalModel; }; +USTRUCT(BlueprintType) +struct FHoldableObjectRow : public FTableRowBase +{ + GENERATED_BODY() + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite) + UBlueprintGeneratedClass* Object; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + UTexture2D* Image; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + int32 Price; +}; + UCLASS() class UNREAL_API ADataTableRow : public AActor { GENERATED_BODY() - -public: - // Sets default values for this actor's properties - ADataTableRow(); - }; diff --git a/Unreal 5.0/Source/Unreal/HoldableObject.cpp b/Unreal 5.0/Source/Unreal/HoldableObject.cpp index 961dab8..8469f47 100644 --- a/Unreal 5.0/Source/Unreal/HoldableObject.cpp +++ b/Unreal 5.0/Source/Unreal/HoldableObject.cpp @@ -15,3 +15,7 @@ FString UHoldableObject::GetName() { return Name; } +int32 UHoldableObject::GetPrice() { + return Price; +} + diff --git a/Unreal 5.0/Source/Unreal/HoldableObject.h b/Unreal 5.0/Source/Unreal/HoldableObject.h index 7b2ec22..81c8f4f 100644 --- a/Unreal 5.0/Source/Unreal/HoldableObject.h +++ b/Unreal 5.0/Source/Unreal/HoldableObject.h @@ -19,8 +19,12 @@ class UNREAL_API UHoldableObject : public UActorComponent public: int32 GetWeight(void); + UFUNCTION(BlueprintCallable) FString GetName(); + UFUNCTION(BlueprintCallable) + int32 GetPrice(); + protected: UPROPERTY(EditAnywhere) FString Name; diff --git a/Unreal 5.0/Source/Unreal/Incubator.cpp b/Unreal 5.0/Source/Unreal/Incubator.cpp index 0518a03..98a7f60 100644 --- a/Unreal 5.0/Source/Unreal/Incubator.cpp +++ b/Unreal 5.0/Source/Unreal/Incubator.cpp @@ -46,7 +46,7 @@ void UIncubator::PutCommodity(AActor* CommodityRef) { CommodityGrowthDuration = GrowingCommodityRef->GetGrowthTime(); StartGrowingTime = Cast(GetWorld()->GetGameInstance())->GetGameTime(); - ResultRow = CommodityTable->FindRow(*GrowingCommodityRef->GetName(), ""); + ResultRow = CommodityTable->FindRow(*GrowingCommodityRef->GetName(), ""); if (ResultRow == nullptr) { UE_LOG(LogTemp, Warning, TEXT("Table Error")); diff --git a/Unreal 5.0/Source/Unreal/Incubator.h b/Unreal 5.0/Source/Unreal/Incubator.h index 5b0c8e1..13cf023 100644 --- a/Unreal 5.0/Source/Unreal/Incubator.h +++ b/Unreal 5.0/Source/Unreal/Incubator.h @@ -52,7 +52,7 @@ class UNREAL_API UIncubator : public UActorComponent UCommodity* GrowingCommodityRef; int32 CommodityGrowthDuration; - FCommodityRow* ResultRow; + FProductRow* ResultRow; FDateTime StartGrowingTime; diff --git a/Unreal 5.0/Source/Unreal/PlayerCharacter.cpp b/Unreal 5.0/Source/Unreal/PlayerCharacter.cpp index 5afae7a..4e360da 100644 --- a/Unreal 5.0/Source/Unreal/PlayerCharacter.cpp +++ b/Unreal 5.0/Source/Unreal/PlayerCharacter.cpp @@ -6,7 +6,7 @@ APlayerCharacter::APlayerCharacter() { // Set size for collision capsule - GetCapsuleComponent()->InitCapsuleSize(55.f, 15.f); + GetCapsuleComponent()->InitCapsuleSize(90.f, 15.f); PlayerCamera = CreateDefaultSubobject(TEXT("PlayerCamera")); PlayerCamera->SetupAttachment(GetCapsuleComponent()); diff --git a/Unreal 5.0/Source/Unreal/PlayerHand.cpp b/Unreal 5.0/Source/Unreal/PlayerHand.cpp index 462170c..69f0d26 100644 --- a/Unreal 5.0/Source/Unreal/PlayerHand.cpp +++ b/Unreal 5.0/Source/Unreal/PlayerHand.cpp @@ -77,6 +77,7 @@ void UPlayerHand::Hold(AActor* Target) { if (auto TargetKit = Target->FindComponentByClass()) { TargetKit->SpawnHologram(); PlayerCharacterRef->FindComponentByClass()->bIsConstructing = true; + SetRightHand(); } } diff --git a/Unreal 5.0/Source/Unreal/PlayerInteraction.cpp b/Unreal 5.0/Source/Unreal/PlayerInteraction.cpp index a6e58d9..b6fcb10 100644 --- a/Unreal 5.0/Source/Unreal/PlayerInteraction.cpp +++ b/Unreal 5.0/Source/Unreal/PlayerInteraction.cpp @@ -39,26 +39,32 @@ void UPlayerInteraction::TickComponent(float DeltaTime, ELevelTick TickType, FAc // Check if player can construct and change GUI. [LSH] void UPlayerInteraction::IsConstructable() { FHitResult Hit = PlayerLineTraceRef->GetHitResult(); - bIsHit = true; + bIsHit = false; if (Hit.GetActor()) { + bIsHit = true; if (Hit.GetActor()->ActorHasTag("Floor")) { - PlayerHandRef->SetRightHand(); PlayerHandRef->GetRightHand()->FindComponentByClass() ->SetHologramPosition(Hit.Location, PlayerLineTraceRef->GetPlayerRotation()); bIsInteractable = true; } + else { + PlayerHandRef->GetRightHand()->FindComponentByClass() + ->SetHologramPosition(FVector(0., -1000., 0.), PlayerLineTraceRef->GetPlayerRotation()); + bIsInteractable = false; + } } else { Hit = PlayerLineTraceRef->ForceLineTraceObject(); if (Hit.GetActor()) { + bIsHit = true; // TODO : Check dust chute : change interactable to true } PlayerHandRef->GetRightHand()->FindComponentByClass() ->SetHologramPosition(FVector(0., -1000., 0.), PlayerLineTraceRef->GetPlayerRotation()); - PlayerHandRef->ResetSwapValues(); + bIsInteractable = false; } } diff --git a/Unreal 5.0/Source/Unreal/PlayerLineTrace.cpp b/Unreal 5.0/Source/Unreal/PlayerLineTrace.cpp index 325a448..4341b5e 100644 --- a/Unreal 5.0/Source/Unreal/PlayerLineTrace.cpp +++ b/Unreal 5.0/Source/Unreal/PlayerLineTrace.cpp @@ -5,14 +5,14 @@ UPlayerLineTrace::UPlayerLineTrace() { PrimaryComponentTick.bCanEverTick = true; + LineTraceObject = new LineTraceObjectStrategy(GetOwner(), GetWorld()); + LineTraceFloor = new LineTraceFloorStrategy(GetOwner(), GetWorld()); } void UPlayerLineTrace::BeginPlay() { Super::BeginPlay(); - LineTraceObject = new LineTraceObjectStrategy(GetOwner(), GetWorld()); - LineTraceFloor = new LineTraceFloorStrategy(GetOwner(), GetWorld()); ActiveLineTrace = LineTraceObject; } diff --git a/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.cpp b/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.cpp index 99b3d7f..727c8be 100644 --- a/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.cpp +++ b/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.cpp @@ -3,6 +3,11 @@ #include "SmartFactoryGameInstance.h" +void USmartFactoryGameInstance::CurrencyChange(int32 Amount) { + Currency += Amount; + CurrencyDelegate.Broadcast(Currency); +} + FDateTime USmartFactoryGameInstance::GetGameTime(void) { return GameTime; } \ No newline at end of file diff --git a/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.h b/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.h index 9a972f8..9e18db2 100644 --- a/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.h +++ b/Unreal 5.0/Source/Unreal/SmartFactoryGameInstance.h @@ -6,11 +6,8 @@ #include "Engine/GameInstance.h" #include "SmartFactoryGameInstance.generated.h" -/** - * - */ - DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCheckTimeDelegate, FDateTime, CurrentTime); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCurrencySpendDelegate, int32, Currency); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FNightDelegate); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FMorningDelegate); @@ -30,8 +27,12 @@ class UNREAL_API USmartFactoryGameInstance : public UGameInstance UPROPERTY(EditAnywhere, BlueprintReadWrite) bool bIsNight; + UFUNCTION(BlueprintCallable) FDateTime GetGameTime(); + UFUNCTION(BlueprintCallable) + void CurrencyChange(int32 Amount); + UPROPERTY(BlueprintAssignable, VisibleAnywhere, BlueprintCallable, Category = "Event") FCheckTimeDelegate CheckTimeDelegate; @@ -40,4 +41,7 @@ class UNREAL_API USmartFactoryGameInstance : public UGameInstance UPROPERTY(BlueprintAssignable, VisibleAnywhere, BlueprintCallable, Category = "Event") FMorningDelegate MorningDelegate; + + UPROPERTY(BlueprintAssignable, VisibleAnywhere, BlueprintCallable, Category = "Event") + FCurrencySpendDelegate CurrencyDelegate; };