Merge branch 'dev' into AI

This commit is contained in:
Philip W 2024-02-05 17:05:06 +00:00
commit 8bd990107f
45 changed files with 463 additions and 84 deletions

View File

@ -8,14 +8,15 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="dfa3053d-1d51-4dad-9270-4c17e086f627" name="Changes" comment=""> <list default="true" id="dfa3053d-1d51-4dad-9270-4c17e086f627" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/DialogueSystemEditor/DialogueSystemEditor.Build.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DialogueSystemEditor/DialogueSystemEditor.Build.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/PauseMenu/WBP_PauseMenu.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/PauseMenu/WBP_PauseMenu.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta.Target.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta.Target.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/PauseMenu/WBP_TestMenuTab.uasset" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueEdge.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueEdge.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/StarterContent/Architecture/Floor_400x400.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Architecture/Floor_400x400.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueRootNode.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueRootNode.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/StarterContent/Particles/P_Ambient_Dust.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Particles/P_Ambient_Dust.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueTree.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueTree.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/PauseMenu/PauseMenuClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/PauseMenu/PauseMenuClass.h" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -28,37 +29,37 @@
<component name="MarkdownSettingsMigration"> <component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" /> <option name="stateVersion" value="1" />
</component> </component>
<component name="ProjectColorInfo"><![CDATA[{ <component name="ProjectColorInfo">{
"customColor": "", &quot;customColor&quot;: &quot;&quot;,
"associatedIndex": 7 &quot;associatedIndex&quot;: 7
}]]></component> }</component>
<component name="ProjectId" id="2bp7o8dmlHZgRsYmVepgy7lbmpM" /> <component name="ProjectId" id="2bp7o8dmlHZgRsYmVepgy7lbmpM" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"C++ Project.EndlessVendetta.executor": "Run", &quot;C++ Project.EndlessVendetta.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"git-widget-placeholder": "TempBuildSetup", &quot;git-widget-placeholder&quot;: &quot;PauseMenu&quot;,
"ignore.virus.scanning.warn.message": "true", &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}, },
"keyToStringList": { &quot;keyToStringList&quot;: {
"rider.external.source.directories": [ &quot;rider.external.source.directories&quot;: [
"C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache", &quot;C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache&quot;,
"C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache", &quot;C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache&quot;,
"C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src" &quot;C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src&quot;
] ]
} }
}]]></component> }</component>
<component name="RunManager"> <component name="RunManager">
<configuration name="EndlessVendetta" type="CppProject" factoryName="C++ Project"> <configuration name="EndlessVendetta" type="CppProject" factoryName="C++ Project">
<configuration_1> <configuration_1>
@ -131,6 +132,9 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1706900339638</updated> <updated>1706900339638</updated>
<workItem from="1706900342753" duration="2652000" /> <workItem from="1706900342753" duration="2652000" />
<workItem from="1706972179014" duration="11096000" />
<workItem from="1707046474738" duration="8878000" />
<workItem from="1707103463352" duration="6662000" />
</task> </task>
<servers /> <servers />
</component> </component>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
EndlessVendetta/Content/MainMenu/Music/Manu_maybe_3.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
EndlessVendetta/Content/MainMenu/Music/Manu_maybe_3.wav (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
EndlessVendetta/Content/MainMenu/Music/Menu_maybe_3.1.wav (Stored with Git LFS) Normal file

Binary file not shown.

BIN
EndlessVendetta/Content/MainMenu/Music/Menu_maybe_3_1.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
EndlessVendetta/Content/PauseMenu/PauseMenuBackground.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
EndlessVendetta/Content/PauseMenu/PauseMenuBackground.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
EndlessVendetta/Content/PauseMenu/Tabs/WBP_QuitTab.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
EndlessVendetta/Content/PauseMenu/WBP_PauseMenu.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -188,10 +188,10 @@ void ABountyDirector::BuyEnemyRadio()
void ABountyDirector::BuyFavours() void ABountyDirector::BuyFavours()
{ {
if (PlayerChar->Money < FavourCost) return; // if (PlayerChar->Money < FavourCost) return;
PlayerChar->Money -= FavourCost; // PlayerChar->Money -= FavourCost;
Favours++; // Favours++;
PC_Display->UpdateFavourCount(Favours); // PC_Display->UpdateFavourCount(Favours);
} }
// ----------- PC Display --------------- // ----------- PC Display ---------------

View File

@ -23,6 +23,10 @@ class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
// Used to Store Ref for Bounty Tracking Functionality // Used to Store Ref for Bounty Tracking Functionality
ACheckpointClass* OpenWorldcheckpoint; ACheckpointClass* OpenWorldcheckpoint;
// Used by Players Character to Determine where to Spawn in the Open World after Completing Main Bounty
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
FTransform PlayerSpawnTransform;
protected: protected:
@ -40,6 +44,11 @@ public:
// Spawns the Single Checkpoint in the Open World for this Main Bounty // Spawns the Single Checkpoint in the Open World for this Main Bounty
void SpawnOpenWorldCheckpoint(); void SpawnOpenWorldCheckpoint();
// Used by Players Character to Determine where to Spawn in the Open World after Completing Main Bounty
FTransform GetPlayerSpawnTransform()
{
return PlayerSpawnTransform;
}

View File

@ -3,15 +3,12 @@
#include "BountyHunterCharacter.h" #include "BountyHunterCharacter.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "EnhancedInputComponent.h"
void ABountyHunterCharacter::SpawnMainBounty() void ABountyHunterCharacter::SpawnMainBounty(UEVGameInstance* GI)
{ {
UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (!IsValid(GI->MainSaveGameInstanceRef)) return;
CurrentMainBountyIndex = GI->MainSaveGameInstanceRef->LastMainBountyIndexInOpenWorld; CurrentMainBountyIndex = GI->MainSaveGameInstanceRef->LastMainBountyIndexInOpenWorld;
UE_LOG(LogTemp, Warning, TEXT("Loaded current bounty as %d"), CurrentMainBountyIndex);
if (GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave > CurrentMainBountyIndex) CompleteCurrentMainBounty(GI); if (GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave > CurrentMainBountyIndex) CompleteCurrentMainBounty(GI);
if (MainBountyClasses.IsEmpty() || MainBountyClasses.Num() <= CurrentMainBountyIndex|| !IsValid(MainBountyClasses[CurrentMainBountyIndex])) if (MainBountyClasses.IsEmpty() || MainBountyClasses.Num() <= CurrentMainBountyIndex|| !IsValid(MainBountyClasses[CurrentMainBountyIndex]))
@ -36,6 +33,10 @@ void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI)
// Collect rewards for bounty and move onto next // Collect rewards for bounty and move onto next
UE_LOG(LogTemp, Warning, TEXT("Would be collecting reward for completing bounty %d"), CurrentMainBountyIndex); UE_LOG(LogTemp, Warning, TEXT("Would be collecting reward for completing bounty %d"), CurrentMainBountyIndex);
FTransform PostBountySpawnTransform = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetPlayerSpawnTransform();
SetActorTransform(PostBountySpawnTransform);
Cast<APlayerController>(GetController())->SetControlRotation(PostBountySpawnTransform.GetRotation().Rotator());
CurrentMainBountyIndex = GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave; CurrentMainBountyIndex = GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave;
GI->MainSaveGameInstanceRef->LastMainBountyIndexInOpenWorld = CurrentMainBountyIndex; GI->MainSaveGameInstanceRef->LastMainBountyIndexInOpenWorld = CurrentMainBountyIndex;
UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0); UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
@ -48,12 +49,93 @@ void ABountyHunterCharacter::AllBountiesCompleted()
void ABountyHunterCharacter::BeginPlay() void ABountyHunterCharacter::BeginPlay()
{ {
if (UGameplayStatics::DoesSaveGameExist("MainSave", 0)) SpawnMainBounty(); UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (IsValid(GI->MainSaveGameInstanceRef))
{
SpawnMainBounty(GI);
FTransform SpawnLoc = GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave;
if (SpawnLoc.GetLocation() != FVector(0, 0, 0) && UGameplayStatics::GetCurrentLevelName(GetWorld()) == OpenWorldLevelName)
{
SetActorTransform(GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave);
Cast<APlayerController>(GetController())->SetControlRotation(GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave.GetRotation().Rotator());
}
}
CreatePauseMenuTabs();
Super::BeginPlay(); Super::BeginPlay();
} }
void ABountyHunterCharacter::Tick(float DeltaTime) void ABountyHunterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{ {
Super::Tick(DeltaTime); if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(PlayerInputComponent))
{
EnhancedInputComponent->BindAction(PauseMenuAction, ETriggerEvent::Started, this, &ABountyHunterCharacter::TogglePauseMenu);
}
UE_LOG(LogTemp, Warning, TEXT("Setup player input on bounty hunter character"));
Super::SetupPlayerInputComponent(PlayerInputComponent);
} }
void ABountyHunterCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
if (UGameplayStatics::GetCurrentLevelName(GetWorld()) != OpenWorldLevelName) return;
UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (!IsValid(GI->MainSaveGameInstanceRef)) return;
TArray<AActor*> LandingZones;
ALandingZone* ClosestLandingZone = nullptr;
double DistToClosestLandingZone;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), ALandingZone::StaticClass(), LandingZones);
for (AActor* LZ_Actor : LandingZones)
{
ALandingZone* LZ = Cast<ALandingZone>(LZ_Actor);
double DistToLZ = FVector::Dist(LZ->GetExitTransform().GetLocation(), GetActorLocation());
if (!IsValid(ClosestLandingZone))
{
ClosestLandingZone = LZ;
DistToClosestLandingZone = DistToLZ;
continue;
}
ClosestLandingZone = DistToClosestLandingZone >= DistToLZ ? LZ : ClosestLandingZone;
DistToClosestLandingZone = DistToClosestLandingZone >= DistToLZ ? DistToLZ : DistToClosestLandingZone;
}
if (!IsValid(ClosestLandingZone)) return;
GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = ClosestLandingZone->GetExitTransform();
UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
}
void ABountyHunterCharacter::CreatePauseMenuTabs()
{
BountiesTab = CreateWidget<UBountiesTab>(GetWorld(), BountyTabWidgetClass);
FavoursTab = CreateWidget<UTabWidget>(GetWorld(), FavoursTabWidgetClass);
NavigationTab = CreateWidget<UTabWidget>(GetWorld(), NavigationTabWidgetClass);
SettingsTab = CreateWidget<UTabWidget>(GetWorld(), SettingsTabWidgetClass);
QuitTab = CreateWidget<UQuitTab>(GetWorld(), QuitTabWidgetClass);
}
void ABountyHunterCharacter::TogglePauseMenu()
{
const bool bOpenNewPauseMenu = !IsValid(PauseMenu);
FInputModeUIOnly UIOnly;
FInputModeGameOnly GameOnly;
APlayerController* PC = Cast<APlayerController>(GetController());
InPauseMenu = bOpenNewPauseMenu;
PC->SetIgnoreMoveInput(bOpenNewPauseMenu);
PC->SetIgnoreLookInput(bOpenNewPauseMenu);
PC->SetShowMouseCursor(bOpenNewPauseMenu);
if (!bOpenNewPauseMenu)
{
PauseMenu->RemoveFromParent();
PauseMenu = nullptr;
return;
}
PauseMenu = CreateWidget<UPauseMenuClass>(GetWorld(), PauseMenuWidgetClass);
PauseMenu->AddToViewport(50);
PauseMenu->OpenNewTab(BountiesTab);
PauseMenu->OpenedBountiesTab.AddDynamic(this, &ABountyHunterCharacter::OpenBountiesTab);
PauseMenu->OpenedFavoursTab.AddDynamic(this, &ABountyHunterCharacter::OpenFavoursTab);
PauseMenu->OpenedNavigationTab.AddDynamic(this, &ABountyHunterCharacter::OpenNavigationTab);
PauseMenu->OpenedSettingsTab.AddDynamic(this, &ABountyHunterCharacter::OpenSettingsTab);
PauseMenu->OpenedQuitTab.AddDynamic(this, &ABountyHunterCharacter::OpenQuitTab);
}

View File

@ -7,6 +7,9 @@
#include "EndlessVendetta/EVGameInstance.h" #include "EndlessVendetta/EVGameInstance.h"
#include "EndlessVendetta/MainSaveGameClass.h" #include "EndlessVendetta/MainSaveGameClass.h"
#include "EndlessVendetta/BountySystem/MainBountyClass.h" #include "EndlessVendetta/BountySystem/MainBountyClass.h"
#include "EndlessVendetta/PauseMenu/BountiesTab.h"
#include "EndlessVendetta/PauseMenu/PauseMenuClass.h"
#include "EndlessVendetta/PauseMenu/QuitTab.h"
#include "BountyHunterCharacter.generated.h" #include "BountyHunterCharacter.generated.h"
/** /**
@ -34,13 +37,12 @@ class ENDLESSVENDETTA_API ABountyHunterCharacter : public AEndlessVendettaCharac
protected: protected:
public: public:
// ------------------- METHODS --------------------------------- // ------------------- METHODS ---------------------------------
private: private:
// Spawns Current Main Bounty along with its Side Bounties, and spawns its appropriate CP's based on level // Spawns Current Main Bounty along with its Side Bounties, and spawns its appropriate CP's based on level
void SpawnMainBounty(); void SpawnMainBounty(UEVGameInstance* GI);
// Collects Reward for Current Main Bounty and Increments the Main Bounty Index // Collects Reward for Current Main Bounty and Increments the Main Bounty Index
void CompleteCurrentMainBounty(UEVGameInstance* GI); void CompleteCurrentMainBounty(UEVGameInstance* GI);
@ -52,8 +54,12 @@ protected:
// Called When Player Spawns // Called When Player Spawns
virtual void BeginPlay() override; virtual void BeginPlay() override;
// Called every frame // Overridden to Setup up Pause Menu Inputs
virtual void Tick(float DeltaTime) override; virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
// Called When Actor destroyed or Removed from Level
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
public: public:
// Used by Final Checkpoint to always load the Level set as the Open Level in here // Used by Final Checkpoint to always load the Level set as the Open Level in here
FString GetOpenWorldLevelName() FString GetOpenWorldLevelName()
@ -61,4 +67,97 @@ public:
return OpenWorldLevelName; return OpenWorldLevelName;
} }
// ------------------- Pause Menu ---------------------------------
private:
// Input Action for Opening and Closing Pause Menu
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
UInputAction* PauseMenuAction;
// Widget Class used to Spawn Pause Menu
UPROPERTY(EditDefaultsOnly, Category = PauseMenu)
TSubclassOf<UPauseMenuClass> PauseMenuWidgetClass;
// Reference to Pause Menu Widget
UPauseMenuClass* PauseMenu;
// Widget Class used to Spawn Bounties Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UBountiesTab> BountyTabWidgetClass;
// Reference to Bounty Tab Widget
UPROPERTY()
UBountiesTab* BountiesTab;
// Widget Class used to Spawn Favours Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UTabWidget> FavoursTabWidgetClass;
// Reference to Favours Tab Widget
UPROPERTY()
UTabWidget* FavoursTab;
// Widget Class used to Spawn Navigation Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UTabWidget> NavigationTabWidgetClass;
// Reference to Navigation Tab Widget
UPROPERTY()
UTabWidget* NavigationTab;
// Widget Class used to Spawn Settings Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UTabWidget> SettingsTabWidgetClass;
// Reference to Settings Tab Widget
UPROPERTY()
UTabWidget* SettingsTab;
// Widget Class used to Spawn Quit Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UQuitTab> QuitTabWidgetClass;
// Reference to Quit Tab Widget
UPROPERTY()
UQuitTab* QuitTab;
// Creates and Stores References to each Pause Menu Tab on Begin Play
void CreatePauseMenuTabs();
// Open or Close the Pause Menu, Defaults to Opening Bounty Tab
void TogglePauseMenu();
// Opens Bounties Tab
UFUNCTION()
void OpenBountiesTab()
{
PauseMenu->OpenNewTab(BountiesTab);
}
// Opens Favours Tab
UFUNCTION()
void OpenFavoursTab()
{
PauseMenu->OpenNewTab(FavoursTab);
}
// Opens Navigation Tab
UFUNCTION()
void OpenNavigationTab()
{
PauseMenu->OpenNewTab(NavigationTab);
}
// Opens Settings Tab
UFUNCTION()
void OpenSettingsTab()
{
PauseMenu->OpenNewTab(SettingsTab);
}
// Opens Quit Tab
UFUNCTION()
void OpenQuitTab()
{
PauseMenu->OpenNewTab(QuitTab);
}
}; };

View File

@ -70,6 +70,7 @@ void AMyVICharacterBase::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& O
void AMyVICharacterBase::Jump() void AMyVICharacterBase::Jump()
{ {
if (PlayerOnShip || InPauseMenu) return;
// If missing critical components then jump and exit // If missing critical components then jump and exit
if (!VaultComponent || !GetCharacterMovement()) if (!VaultComponent || !GetCharacterMovement())
{ {

View File

@ -216,10 +216,12 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent*
//Interacting //Interacting
EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Interact); EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Interact);
} }
UE_LOG(LogTemp, Warning, TEXT("Setup player input on EV character"));
} }
void AEndlessVendettaCharacter::Interact() void AEndlessVendettaCharacter::Interact()
{ {
if (InPauseMenu) return;
if (bIsInDialogue) if (bIsInDialogue)
{ {
Cast<UAC_PlayerDialogueInterpreter>(GetComponentByClass(UAC_PlayerDialogueInterpreter::StaticClass()))->NextDialogue(); Cast<UAC_PlayerDialogueInterpreter>(GetComponentByClass(UAC_PlayerDialogueInterpreter::StaticClass()))->NextDialogue();
@ -257,7 +259,7 @@ void AEndlessVendettaCharacter::Interact()
void AEndlessVendettaCharacter::SetCrouch() void AEndlessVendettaCharacter::SetCrouch()
{ {
if (PlayerOnShip) return; if (PlayerOnShip || InPauseMenu) return;
Crouch(); Crouch();
} }
@ -301,7 +303,7 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
void AEndlessVendettaCharacter::ToggleRecon() void AEndlessVendettaCharacter::ToggleRecon()
{ {
if (PlayerOnShip) return; if (PlayerOnShip || InPauseMenu) return;
if (!GadgetManager->IsValidReconGadget()) return; if (!GadgetManager->IsValidReconGadget()) return;
if (IsValid(PrimaryWeapon)) EquipPrimary(); if (IsValid(PrimaryWeapon)) EquipPrimary();
@ -324,7 +326,7 @@ void AEndlessVendettaCharacter::ToggleRecon()
void AEndlessVendettaCharacter::ToggleCombat() void AEndlessVendettaCharacter::ToggleCombat()
{ {
if (PlayerOnShip) return; if (PlayerOnShip || InPauseMenu) return;
if (!GadgetManager->IsValidCombatGadget()) return; if (!GadgetManager->IsValidCombatGadget()) return;
if (IsValid(PrimaryWeapon)) EquipPrimary(); if (IsValid(PrimaryWeapon)) EquipPrimary();
@ -349,7 +351,7 @@ void AEndlessVendettaCharacter::ToggleCombat()
//When 1 is pressed it calls EquipPrimary //When 1 is pressed it calls EquipPrimary
void AEndlessVendettaCharacter::EquipPrimary() void AEndlessVendettaCharacter::EquipPrimary()
{ {
if (PlayerOnShip) return; if (PlayerOnShip || InPauseMenu) return;
if (!IsValid(PrimaryWeaponClass)) return; if (!IsValid(PrimaryWeaponClass)) return;
FActorSpawnParameters spawnParams; FActorSpawnParameters spawnParams;
spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
@ -421,7 +423,7 @@ void AEndlessVendettaCharacter::EquipPrimary()
void AEndlessVendettaCharacter::EquipSecondary() void AEndlessVendettaCharacter::EquipSecondary()
{ {
if (!IsValid(SecondaryWeaponClass)) return; if (!IsValid(SecondaryWeaponClass)) return;
if (PlayerOnShip) return; if (PlayerOnShip || InPauseMenu) return;
FActorSpawnParameters spawnParams; FActorSpawnParameters spawnParams;
spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
@ -518,6 +520,7 @@ void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
//Calls the fire function in the baseWeaponClass //Calls the fire function in the baseWeaponClass
void AEndlessVendettaCharacter::FireCaller() void AEndlessVendettaCharacter::FireCaller()
{ {
if (InPauseMenu) return;
if (IsValid(PrimaryWeapon) && !bIsReloading) if (IsValid(PrimaryWeapon) && !bIsReloading)
{ {
PrimaryWeapon->Fire(); PrimaryWeapon->Fire();
@ -542,6 +545,7 @@ void AEndlessVendettaCharacter::StopFire()
void AEndlessVendettaCharacter::GunRightClick() void AEndlessVendettaCharacter::GunRightClick()
{ {
if (InPauseMenu) return;
if (IsValid(PrimaryWeapon) && !bIsScoped) if (IsValid(PrimaryWeapon) && !bIsScoped)
{ {
bIsScoped = true; bIsScoped = true;
@ -578,6 +582,7 @@ void AEndlessVendettaCharacter::StopGunRightClick()
void AEndlessVendettaCharacter::GunReload() void AEndlessVendettaCharacter::GunReload()
{ {
if (InPauseMenu) return;
if (IsValid(PrimaryWeapon)) if (IsValid(PrimaryWeapon))
{ {
PrimaryWeapon->ReloadTimer(); PrimaryWeapon->ReloadTimer();
@ -617,6 +622,7 @@ void AEndlessVendettaCharacter::Move(const FInputActionValue& Value)
void AEndlessVendettaCharacter::Sprint() void AEndlessVendettaCharacter::Sprint()
{ {
if (InPauseMenu) return;
bIsPlayerSprinting = true; bIsPlayerSprinting = true;
if (bIsPlayerSprinting) if (bIsPlayerSprinting)
{ {
@ -728,8 +734,15 @@ void AEndlessVendettaCharacter::EnterShip(FTransform TakeoffLoc)
void AEndlessVendettaCharacter::ExitShip(FTransform ExitLoc) void AEndlessVendettaCharacter::ExitShip(FTransform ExitLoc)
{ {
PlayFadeScreen(); PlayFadeScreen();
SetActorLocation(ExitLoc.GetLocation()); APlayerController* PC = Cast<APlayerController>(GetController());
PC->SetIgnoreMoveInput(true);
PC->SetIgnoreLookInput(true);
SpaceShip->GetCharacterMovement()->Velocity = FVector(0, 0, 0);
GetCharacterMovement()->Velocity = FVector(0, 0, 0);
SetActorLocation(ExitLoc.GetLocation(), false, nullptr, ETeleportType::ResetPhysics);
GetController()->SetControlRotation(ExitLoc.Rotator()); GetController()->SetControlRotation(ExitLoc.Rotator());
SpaceShip->Destroy(); SpaceShip->Destroy();
PlayerOnShip = false; PlayerOnShip = false;
PC->SetIgnoreMoveInput(false);
PC->SetIgnoreLookInput(false);
} }

View File

@ -133,6 +133,8 @@ protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;
virtual void Tick(float DeltaTime) override; virtual void Tick(float DeltaTime) override;
bool InPauseMenu = false;
UPROPERTY(EditDefaultsOnly, Category = "Gadget") UPROPERTY(EditDefaultsOnly, Category = "Gadget")
TSubclassOf<AGadgetManager> GadgetManagerClass; TSubclassOf<AGadgetManager> GadgetManagerClass;
@ -145,7 +147,6 @@ protected:
void PlayFadeScreen(); void PlayFadeScreen();
public: public:
int Money = 2000;
AGadgetManager* GadgetManager; AGadgetManager* GadgetManager;
bool bIsReloading = false; bool bIsReloading = false;
@ -269,11 +270,11 @@ public:
// Space Ship // Space Ship
private: private:
bool PlayerOnShip = false;
UPROPERTY(EditDefaultsOnly, Category = "Space Ship") UPROPERTY(EditDefaultsOnly, Category = "Space Ship")
TSubclassOf<ASpaceShip> SpaceShipClass; TSubclassOf<ASpaceShip> SpaceShipClass;
ASpaceShip* SpaceShip; ASpaceShip* SpaceShip;
protected:
bool PlayerOnShip = false;
public: public:
void ExitShip(FTransform ExitLoc); void ExitShip(FTransform ExitLoc);
void EnterShip(FTransform TakeoffLoc); void EnterShip(FTransform TakeoffLoc);

View File

@ -28,4 +28,6 @@ public:
UPROPERTY() UPROPERTY()
TSubclassOf<ABaseWeaponClass> SecondaryWeaponClassSave; TSubclassOf<ABaseWeaponClass> SecondaryWeaponClassSave;
UPROPERTY()
FTransform PlayerOpenWorldSpawnTransformSave;
}; };

View File

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

View File

@ -0,0 +1,31 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "TabWidget.h"
#include "EndlessVendetta/BountySystem/BountyClass.h"
#include "BountiesTab.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FTrackBounty, ABountyClass*, BountyToTrack);
UCLASS()
class ENDLESSVENDETTA_API UBountiesTab : public UTabWidget
{
GENERATED_BODY()
// ------------------- ATTRIBUTES ------------------------------
protected:
public:
UPROPERTY(BlueprintAssignable)
FTrackBounty TrackBountyDelegate;
// ------------------- METHODS ---------------------------------
private:
protected:
public:
};

View File

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

View File

@ -0,0 +1,41 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "PauseMenuClass.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOpenedBountiesTab);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOpenedFavoursTab);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOpenedNavigationTab);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOpenedSettingsTab);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOpenedQuitTab);
UCLASS()
class ENDLESSVENDETTA_API UPauseMenuClass : public UUserWidget
{
GENERATED_BODY()
// ------------------- ATTRIBUTES ------------------------------
public:
UPROPERTY(BlueprintCallable)
FOpenedBountiesTab OpenedBountiesTab;
UPROPERTY(BlueprintCallable)
FOpenedFavoursTab OpenedFavoursTab;
UPROPERTY(BlueprintCallable)
FOpenedNavigationTab OpenedNavigationTab;
UPROPERTY(BlueprintCallable)
FOpenedSettingsTab OpenedSettingsTab;
UPROPERTY(BlueprintCallable)
FOpenedQuitTab OpenedQuitTab;
// ------------------- METHODS ---------------------------------
public:
// Closes any Previously Opened Tab and Opens the Given new Tab
UFUNCTION(BlueprintImplementableEvent)
void OpenNewTab(UTabWidget* TabWidget);
};

View File

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

View File

@ -0,0 +1,14 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "TabWidget.h"
#include "QuitTab.generated.h"
UCLASS()
class ENDLESSVENDETTA_API UQuitTab : public UTabWidget
{
GENERATED_BODY()
};

View File

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

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "TabWidget.generated.h"
/**
*
*/
UCLASS()
class ENDLESSVENDETTA_API UTabWidget : public UUserWidget
{
GENERATED_BODY()
};

View File

@ -68,4 +68,10 @@ public:
// Updates all LZ's, then runs enter ship func on player passing the correct takeoff transform // Updates all LZ's, then runs enter ship func on player passing the correct takeoff transform
void Takeoff(); void Takeoff();
// Returns Exit Transform for LZ, Used for Save System for when Player Leaves Open World
FTransform GetExitTransform()
{
return LZ_ExitTransform;
}
}; };