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 name="ChangeListManager">
<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$/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$/Source/DialogueSystemEditor/DialogueSystemEditor.Build.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DialogueSystemEditor/DialogueSystemEditor.Build.cs" 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$/Source/EndlessVendetta/DialogueSystem/DialogueEdge.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueEdge.h" 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$/Source/EndlessVendetta/DialogueSystem/DialogueTree.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/DialogueSystem/DialogueTree.cpp" 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$/Content/PauseMenu/WBP_PauseMenu.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/PauseMenu/WBP_PauseMenu.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/PauseMenu/WBP_TestMenuTab.uasset" beforeDir="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$/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/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>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -28,37 +29,37 @@
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"customColor": "",
"associatedIndex": 7
}]]></component>
<component name="ProjectColorInfo">{
&quot;customColor&quot;: &quot;&quot;,
&quot;associatedIndex&quot;: 7
}</component>
<component name="ProjectId" id="2bp7o8dmlHZgRsYmVepgy7lbmpM" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"C++ Project.EndlessVendetta.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "TempBuildSetup",
"ignore.virus.scanning.warn.message": "true",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;C++ Project.EndlessVendetta.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;PauseMenu&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
},
"keyToStringList": {
"rider.external.source.directories": [
"C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache",
"C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache",
"C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src"
&quot;keyToStringList&quot;: {
&quot;rider.external.source.directories&quot;: [
&quot;C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache&quot;,
&quot;C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache&quot;,
&quot;C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src&quot;
]
}
}]]></component>
}</component>
<component name="RunManager">
<configuration name="EndlessVendetta" type="CppProject" factoryName="C++ Project">
<configuration_1>
@ -131,6 +132,9 @@
<option name="presentableId" value="Default" />
<updated>1706900339638</updated>
<workItem from="1706900342753" duration="2652000" />
<workItem from="1706972179014" duration="11096000" />
<workItem from="1707046474738" duration="8878000" />
<workItem from="1707103463352" duration="6662000" />
</task>
<servers />
</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()
{
if (PlayerChar->Money < FavourCost) return;
PlayerChar->Money -= FavourCost;
Favours++;
PC_Display->UpdateFavourCount(Favours);
// if (PlayerChar->Money < FavourCost) return;
// PlayerChar->Money -= FavourCost;
// Favours++;
// PC_Display->UpdateFavourCount(Favours);
}
// ----------- PC Display ---------------

View File

@ -23,6 +23,10 @@ class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
// Used to Store Ref for Bounty Tracking Functionality
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:
@ -40,6 +44,11 @@ public:
// Spawns the Single Checkpoint in the Open World for this Main Bounty
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 "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;
UE_LOG(LogTemp, Warning, TEXT("Loaded current bounty as %d"), CurrentMainBountyIndex);
if (GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave > CurrentMainBountyIndex) CompleteCurrentMainBounty(GI);
if (MainBountyClasses.IsEmpty() || MainBountyClasses.Num() <= CurrentMainBountyIndex|| !IsValid(MainBountyClasses[CurrentMainBountyIndex]))
@ -35,6 +32,10 @@ void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI)
{
// Collect rewards for bounty and move onto next
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;
GI->MainSaveGameInstanceRef->LastMainBountyIndexInOpenWorld = CurrentMainBountyIndex;
@ -48,12 +49,93 @@ void ABountyHunterCharacter::AllBountiesCompleted()
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();
}
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/MainSaveGameClass.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"
/**
@ -31,34 +34,130 @@ class ENDLESSVENDETTA_API ABountyHunterCharacter : public AEndlessVendettaCharac
// Name of open world, so that the correct bounties can be spawned based on level
UPROPERTY(EditDefaultsOnly, Category = "Bounty Hunter")
FString OpenWorldLevelName = "ControlTutorialLevel";
protected:
protected:
public:
// ------------------- METHODS ---------------------------------
private:
// 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
void CompleteCurrentMainBounty(UEVGameInstance* GI);
// Replaces Normal Bounty Info UI with Unique Game Over UI
void AllBountiesCompleted();
protected:
// Called When Player Spawns
virtual void BeginPlay() override;
// Called every frame
virtual void Tick(float DeltaTime) override;
// Overridden to Setup up Pause Menu Inputs
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
// Called When Actor destroyed or Removed from Level
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
public:
// Used by Final Checkpoint to always load the Level set as the Open Level in here
FString GetOpenWorldLevelName()
{
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()
{
if (PlayerOnShip || InPauseMenu) return;
// If missing critical components then jump and exit
if (!VaultComponent || !GetCharacterMovement())
{

View File

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

View File

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

View File

@ -27,5 +27,7 @@ public:
UPROPERTY()
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
void Takeoff();
// Returns Exit Transform for LZ, Used for Save System for when Player Leaves Open World
FTransform GetExitTransform()
{
return LZ_ExitTransform;
}
};