Implemented PC Display User Widget Class with WIP USTRUCT
This commit is contained in:
parent
64420326c0
commit
cec447eb73
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b32ceb2fef229808e1ce4cb7ed0542b84e6e0b0e6b93e7a6d0bcd7bdeea57895
|
oid sha256:f62b028aaa92370d26281005a26678e2b3d6e2ba93c0ee7ae227a3d2ba6377db
|
||||||
size 18290
|
size 18565
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:029587dac1de32522f1913c7535e675cdab887348dbe9271aa4823a0e5733550
|
||||||
|
size 11826
|
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b37ffa979db56e7f9d07e4c0d02718fa6f15cda90cf7e41886f7301a917cfe15
|
oid sha256:7be067073df07be66cbc1d10a227dbdbdb65550aa37fc9ba7c7c4b7716e2ff41
|
||||||
size 4934
|
size 4397
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default",
|
"LoadingPhase": "Default",
|
||||||
"AdditionalDependencies": [
|
"AdditionalDependencies": [
|
||||||
"Engine"
|
"Engine",
|
||||||
|
"UMG"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -66,6 +66,11 @@ public:
|
|||||||
return BountyDesc;
|
return BountyDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GetBountyreardMoney()
|
||||||
|
{
|
||||||
|
return RewardMoney;
|
||||||
|
}
|
||||||
|
|
||||||
FVector GetCheckpointLocation()
|
FVector GetCheckpointLocation()
|
||||||
{
|
{
|
||||||
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr)
|
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "BountyDirector.h"
|
#include "BountyDirector.h"
|
||||||
|
|
||||||
|
#include "Blueprint/UserWidget.h"
|
||||||
#include "Components/ArrowComponent.h"
|
#include "Components/ArrowComponent.h"
|
||||||
|
|
||||||
// Sets default values
|
// Sets default values
|
||||||
@ -119,13 +120,6 @@ void ABountyDirector::DestroyActiveSideBounties()
|
|||||||
UpdateBountyDisplay();
|
UpdateBountyDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ABountyDirector::Interact()
|
|
||||||
{
|
|
||||||
Super::Interact();
|
|
||||||
UE_LOG(LogTemp, Warning, TEXT("This is where I'll put widget opening code!!!!"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------- Favour Shop ---------------
|
// ----------- Favour Shop ---------------
|
||||||
|
|
||||||
void ABountyDirector::EarnFavours(int FavoursEarned)
|
void ABountyDirector::EarnFavours(int FavoursEarned)
|
||||||
@ -190,4 +184,28 @@ void ABountyDirector::BuyFavours()
|
|||||||
if (PlayerChar->Money < FavourCost) return;
|
if (PlayerChar->Money < FavourCost) return;
|
||||||
PlayerChar->Money -= FavourCost;
|
PlayerChar->Money -= FavourCost;
|
||||||
Favours++;
|
Favours++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------- PC Display ---------------
|
||||||
|
|
||||||
|
void ABountyDirector::Interact()
|
||||||
|
{
|
||||||
|
FInputModeUIOnly InputMode;
|
||||||
|
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
|
||||||
|
|
||||||
|
PC_DisplayWidget = CreateWidget<UUserWidget>(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<UPC_Display>(PC_DisplayWidget);
|
||||||
|
PC_Display->PC_Display_Info.IsGameOver = true;
|
||||||
|
Cast<UPC_Display>(PC_DisplayWidget)->LoadOS();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "SideBountyClass.h"
|
#include "SideBountyClass.h"
|
||||||
#include "EndlessVendetta/EndlessVendettaCharacter.h"
|
#include "EndlessVendetta/EndlessVendettaCharacter.h"
|
||||||
#include "EndlessVendetta/InteractableActor.h"
|
#include "EndlessVendetta/InteractableActor.h"
|
||||||
|
#include "EndlessVendetta/UserWidgets/PC_Display.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "BountyDirector.generated.h"
|
#include "BountyDirector.generated.h"
|
||||||
|
|
||||||
@ -27,6 +28,11 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor
|
|||||||
UPROPERTY(EditDefaultsOnly, Category = "Bounty Director")
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty Director")
|
||||||
int FavourCost = 500;
|
int FavourCost = 500;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category = "Bounty Director")
|
||||||
|
TSubclassOf<UPC_Display> PC_DisplayWidgetClass;
|
||||||
|
|
||||||
|
UUserWidget* PC_DisplayWidget;
|
||||||
|
|
||||||
int CurrentBountyIndex = 0;
|
int CurrentBountyIndex = 0;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, Category = "Bounty")
|
UPROPERTY(VisibleAnywhere, Category = "Bounty")
|
||||||
@ -91,27 +97,33 @@ public:
|
|||||||
ABountyDirector();
|
ABountyDirector();
|
||||||
|
|
||||||
// ------ Getters ------
|
// ------ Getters ------
|
||||||
UFUNCTION(BlueprintCallable, Category = "Bounty")
|
|
||||||
FString GetBountyTitle()
|
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()
|
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)
|
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)
|
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();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -116,14 +116,12 @@ void AEndlessVendettaCharacter::Interact()
|
|||||||
QueryParams.AddIgnoredActor(this);
|
QueryParams.AddIgnoredActor(this);
|
||||||
FVector LT_Start = FirstPersonCameraComponent->GetComponentLocation();
|
FVector LT_Start = FirstPersonCameraComponent->GetComponentLocation();
|
||||||
FVector LT_End = LT_Start + (FirstPersonCameraComponent->GetForwardVector() * InteractionRange);
|
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;
|
if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return;
|
||||||
|
|
||||||
AActor* HitActor = OutHit.GetActor();
|
AActor* HitActor = OutHit.GetActor();
|
||||||
AInteractableActor* InteractableActor = Cast<AInteractableActor>(HitActor);
|
AInteractableActor* InteractableActor = Cast<AInteractableActor>(HitActor);
|
||||||
if (!IsValid(InteractableActor)) return;
|
if (!IsValid(InteractableActor)) return;
|
||||||
|
|
||||||
DrawDebugLine(GetWorld(), LT_Start, OutHit.ImpactPoint, FColor::Green, false, 3, 0, 2);
|
|
||||||
InteractableActor->Interact();
|
InteractableActor->Interact();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "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
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user