diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset index 0c495524..13661ced 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b32ceb2fef229808e1ce4cb7ed0542b84e6e0b0e6b93e7a6d0bcd7bdeea57895 -size 18290 +oid sha256:f62b028aaa92370d26281005a26678e2b3d6e2ba93c0ee7ae227a3d2ba6377db +size 18565 diff --git a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset new file mode 100644 index 00000000..400ff6de --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:029587dac1de32522f1913c7535e675cdab887348dbe9271aa4823a0e5733550 +size 11826 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index bf2e4391..e9b09590 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d -size 43456 +oid sha256:4c7ea4b8f4ba84d970fabbc731c246e0744fe104a295e3422823f0ebb8798ae1 +size 53268 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset index 29ca0d25..a6d9a764 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b37ffa979db56e7f9d07e4c0d02718fa6f15cda90cf7e41886f7301a917cfe15 -size 4934 +oid sha256:7be067073df07be66cbc1d10a227dbdbdb65550aa37fc9ba7c7c4b7716e2ff41 +size 4397 diff --git a/EndlessVendetta/EndlessVendetta.uproject b/EndlessVendetta/EndlessVendetta.uproject index 4717d351..1494b081 100644 --- a/EndlessVendetta/EndlessVendetta.uproject +++ b/EndlessVendetta/EndlessVendetta.uproject @@ -9,7 +9,8 @@ "Type": "Runtime", "LoadingPhase": "Default", "AdditionalDependencies": [ - "Engine" + "Engine", + "UMG" ] } ], diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 607d7945..9f614102 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -66,6 +66,11 @@ public: return BountyDesc; } + int GetBountyreardMoney() + { + return RewardMoney; + } + FVector GetCheckpointLocation() { if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index fbb820d2..ec65c7a5 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -3,6 +3,7 @@ #include "BountyDirector.h" +#include "Blueprint/UserWidget.h" #include "Components/ArrowComponent.h" // Sets default values @@ -119,13 +120,6 @@ void ABountyDirector::DestroyActiveSideBounties() UpdateBountyDisplay(); } -void ABountyDirector::Interact() -{ - Super::Interact(); - UE_LOG(LogTemp, Warning, TEXT("This is where I'll put widget opening code!!!!")); -} - - // ----------- Favour Shop --------------- void ABountyDirector::EarnFavours(int FavoursEarned) @@ -190,4 +184,28 @@ void ABountyDirector::BuyFavours() if (PlayerChar->Money < FavourCost) return; PlayerChar->Money -= FavourCost; Favours++; -} \ No newline at end of file +} + +// ----------- PC Display --------------- + +void ABountyDirector::Interact() +{ + FInputModeUIOnly InputMode; + APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); + + PC_DisplayWidget = CreateWidget(GetWorld(), PC_DisplayWidgetClass); + PC_DisplayWidget->AddToViewport(3); + + PlayerController->SetInputMode(InputMode); + PlayerController->bShowMouseCursor = true; + PlayerController->bEnableClickEvents = true; + PlayerController->bEnableMouseOverEvents = true; + + bool GO = IsValid(ActiveBounty); + + + UPC_Display* PC_Display = Cast(PC_DisplayWidget); + PC_Display->PC_Display_Info.IsGameOver = true; + Cast(PC_DisplayWidget)->LoadOS(); +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 105e4b89..cf36c427 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -7,6 +7,7 @@ #include "SideBountyClass.h" #include "EndlessVendetta/EndlessVendettaCharacter.h" #include "EndlessVendetta/InteractableActor.h" +#include "EndlessVendetta/UserWidgets/PC_Display.h" #include "GameFramework/Actor.h" #include "BountyDirector.generated.h" @@ -27,6 +28,11 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor UPROPERTY(EditDefaultsOnly, Category = "Bounty Director") int FavourCost = 500; + UPROPERTY(EditDefaultsOnly, Category = "Bounty Director") + TSubclassOf PC_DisplayWidgetClass; + + UUserWidget* PC_DisplayWidget; + int CurrentBountyIndex = 0; UPROPERTY(VisibleAnywhere, Category = "Bounty") @@ -91,27 +97,33 @@ public: ABountyDirector(); // ------ Getters ------ - UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetBountyTitle() { - return !IsValid(ActiveBounty) ? FString("N/A") : ActiveBounty->GetBountyTitle(); + return !IsValid(ActiveBounty) ? FString("") : ActiveBounty->GetBountyTitle(); } - UFUNCTION(BlueprintCallable, Category = "Bounty") + UTexture2D* GetBountyIcon() + { + return !IsValid(ActiveBounty) ? nullptr : ActiveBounty->GetActiveWaypointIcon(); + } + FString GetBountyDescription() { - return !IsValid(ActiveBounty) ? FString("N/A") : ActiveBounty->GetBountyDesc(); + return !IsValid(ActiveBounty) ? FString("") : ActiveBounty->GetBountyDesc(); } - UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetBountyReward() + { + return !IsValid(ActiveBounty) ? 0 : ActiveBounty->GetBountyreardMoney(); + } + FString GetSideBountyTitle(int SideBountyIndex) { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("N/A") : ActiveSideBounties[SideBountyIndex]->GetBountyTitle(); + return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyTitle(); } - - UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetSideBountyDescription(int SideBountyIndex) { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("N/A") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); + return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); } }; diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 522245e6..1d8f5d11 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -116,14 +116,12 @@ void AEndlessVendettaCharacter::Interact() QueryParams.AddIgnoredActor(this); FVector LT_Start = FirstPersonCameraComponent->GetComponentLocation(); FVector LT_End = LT_Start + (FirstPersonCameraComponent->GetForwardVector() * InteractionRange); - DrawDebugLine(GetWorld(), LT_Start, LT_End, FColor::Red, false, 3, 0, 2); if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return; AActor* HitActor = OutHit.GetActor(); AInteractableActor* InteractableActor = Cast(HitActor); if (!IsValid(InteractableActor)) return; - DrawDebugLine(GetWorld(), LT_Start, OutHit.ImpactPoint, FColor::Green, false, 3, 0, 2); InteractableActor->Interact(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp new file mode 100644 index 00000000..1909b302 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "PC_Display.h" + + diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h new file mode 100644 index 00000000..86c8579f --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -0,0 +1,55 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "PC_Display.generated.h" + +USTRUCT(BlueprintType) +struct FPC_Display_Info +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + bool IsGameOver; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString MB_Title; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + UTexture2D* MB_Icon; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString MB_Desc; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + int MB_Reward; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString SB_1_Title; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + UTexture2D* SB_1_Icon; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString SB_1_Desc; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + int SB_1_Reward; +}; + +UCLASS() +class ENDLESSVENDETTA_API UPC_Display : public UUserWidget +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") + void LoadOS(); + + UPROPERTY(BlueprintReadOnly) + FPC_Display_Info PC_Display_Info; + //bool IsGameOver, FString& MB_Title, UTexture2D* MB_Icon, FString& MB_Desc, int MB_Reward +}; +