Implemented Bounty Tabs for in Progress Bounties

This commit is contained in:
Rafal Swierczek 2024-02-08 17:40:33 +00:00
parent f1b5e5068c
commit 543c20ea51
11 changed files with 79 additions and 45 deletions

View File

@ -8,19 +8,11 @@
</component>
<component name="ChangeListManager">
<list default="true" id="dfa3053d-1d51-4dad-9270-4c17e086f627" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/Source/EndlessVendetta/PauseMenu/TabStructs/BountyTabInfo.cpp" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Source/EndlessVendetta/PauseMenu/TabStructs/BountyTabInfo.h" 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/BountySystem/ApartmentBounty/MB_Apartment.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/BountySystem/ApartmentBounty/MB_Apartment.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/Bounty/MB_Training.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/Bounty/MB_Training.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/Dialogue/Mayor_tutorial_dialogue_tree.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/Dialogue/Mayor_tutorial_dialogue_tree.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/Levels/MainMenuLevel.umap" beforeDir="false" afterPath="$PROJECT_DIR$/Content/Levels/MainMenuLevel.umap" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/PauseMenu/Tabs/WBP_BountiesTab.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/PauseMenu/Tabs/WBP_BountiesTab.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/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/PauseMenu/Tabs/WBP_BountiesTab.uasset" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset" 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/EndlessVendetta/BountySystem/MainBountyClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/SideBountyClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/SideBountyClass.h" 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/BountiesTab.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/PauseMenu/BountiesTab.h" afterDir="false" />
@ -45,28 +37,28 @@
<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": "PuaseMenuTabs",
"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;PuaseMenuTabs&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>
@ -143,6 +135,7 @@
<workItem from="1707046474738" duration="8878000" />
<workItem from="1707103463352" duration="6662000" />
<workItem from="1707304148719" duration="10277000" />
<workItem from="1707409116575" duration="3559000" />
</task>
<servers />
</component>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4dd8fb12b1bf5ebd10c41083bc1aff236c5daf1d26a1a18aef5e8a07a8975ac6
size 133345

Binary file not shown.

View File

@ -34,10 +34,11 @@ 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());
// FTransform PostBountySpawnTransform = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetPlayerSpawnTransform();
// SetActorTransform(PostBountySpawnTransform);
// Cast<APlayerController>(GetController())->SetControlRotation(PostBountySpawnTransform.GetRotation().Rotator());
GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetPlayerSpawnTransform();
CurrentMainBountyIndex = GI->MainSaveGameInstanceRef->CurrentMainBountyIndexSave;
GI->MainSaveGameInstanceRef->LastMainBountyIndexInOpenWorld = CurrentMainBountyIndex;
UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
@ -59,7 +60,7 @@ void ABountyHunterCharacter::BeginPlay()
{
SetActorTransform(GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave);
Cast<APlayerController>(GetController())->SetControlRotation(GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave.GetRotation().Rotator());
}
}
}
CreatePauseMenuTabs();
Super::BeginPlay();
@ -107,7 +108,15 @@ void ABountyHunterCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
void ABountyHunterCharacter::CreatePauseMenuTabs()
{
BountiesTab = CreateWidget<UBountiesTab>(GetWorld(), BountyTabWidgetClass);
if (CurrentMainBountyIndex <= 0)
{
BountiesTab = CreateWidget<UBountiesTab>(GetWorld(), TutorialBountyTabWidgetClass);
}
else
{
BountiesTab = CreateWidget<UBountiesTab>(GetWorld(), UGameplayStatics::GetCurrentLevelName(GetWorld()) == OpenWorldLevelName ? BountyTabWidgetClass : BountyInProgressTabWidgetClass);
BountiesTab->ReturnToOpenWorldEarlyDelegate.AddDynamic(this, &ABountyHunterCharacter::ReturnToOpenWorldEarly);
}
UpdateBountyTabInfo();
FavoursTab = CreateWidget<UTabWidget>(GetWorld(), FavoursTabWidgetClass);
NavigationTab = CreateWidget<UTabWidget>(GetWorld(), NavigationTabWidgetClass);
@ -140,4 +149,15 @@ void ABountyHunterCharacter::TogglePauseMenu()
PauseMenu->OpenedNavigationTab.AddDynamic(this, &ABountyHunterCharacter::OpenNavigationTab);
PauseMenu->OpenedSettingsTab.AddDynamic(this, &ABountyHunterCharacter::OpenSettingsTab);
PauseMenu->OpenedQuitTab.AddDynamic(this, &ABountyHunterCharacter::OpenQuitTab);
}
}
void ABountyHunterCharacter::ReturnToOpenWorldEarly()
{
UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (!IsValid(GI->MainSaveGameInstanceRef)) return;
FTransform SpawnTransform = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetPlayerSpawnTransform();
GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = SpawnTransform;
UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
UGameplayStatics::OpenLevel(GetWorld(), FName(OpenWorldLevelName));
}

View File

@ -85,6 +85,14 @@ private:
// Widget Class used to Spawn Bounties Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UBountiesTab> BountyTabWidgetClass;
// Widget Class used to Spawn Bounties Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UBountiesTab> BountyInProgressTabWidgetClass;
// Widget Class used to Spawn Bounties Tab Widget
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UBountiesTab> TutorialBountyTabWidgetClass;
// Reference to Bounty Tab Widget
UPROPERTY()
@ -177,4 +185,7 @@ private:
BountiesTab->UpdateBountyTab(BountyTabInfo);
}
UFUNCTION()
void ReturnToOpenWorldEarly();
};

View File

@ -9,6 +9,7 @@
#include "BountiesTab.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FTrackBounty, ABountyClass*, BountyToTrack);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FReturnToOpenWorldEarly);
UCLASS()
class ENDLESSVENDETTA_API UBountiesTab : public UTabWidget
@ -23,6 +24,9 @@ public:
UPROPERTY(BlueprintAssignable)
FTrackBounty TrackBountyDelegate;
UPROPERTY(BlueprintCallable)
FReturnToOpenWorldEarly ReturnToOpenWorldEarlyDelegate;
// ------------------- METHODS ---------------------------------
private: