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>
<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 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$/.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/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.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/PauseMenu/Tabs/WBP_BountiesTab.uasset" beforeDir="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/StarterContent/Blueprints/Blueprint_CeilingLight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset" afterDir="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$/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.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/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" /> <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="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": "PuaseMenuTabs", &quot;git-widget-placeholder&quot;: &quot;PuaseMenuTabs&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>
@ -143,6 +135,7 @@
<workItem from="1707046474738" duration="8878000" /> <workItem from="1707046474738" duration="8878000" />
<workItem from="1707103463352" duration="6662000" /> <workItem from="1707103463352" duration="6662000" />
<workItem from="1707304148719" duration="10277000" /> <workItem from="1707304148719" duration="10277000" />
<workItem from="1707409116575" duration="3559000" />
</task> </task>
<servers /> <servers />
</component> </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 // 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(); // FTransform PostBountySpawnTransform = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetPlayerSpawnTransform();
SetActorTransform(PostBountySpawnTransform); // SetActorTransform(PostBountySpawnTransform);
Cast<APlayerController>(GetController())->SetControlRotation(PostBountySpawnTransform.GetRotation().Rotator()); // Cast<APlayerController>(GetController())->SetControlRotation(PostBountySpawnTransform.GetRotation().Rotator());
GI->MainSaveGameInstanceRef->PlayerOpenWorldSpawnTransformSave = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetPlayerSpawnTransform();
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);
@ -107,7 +108,15 @@ void ABountyHunterCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
void ABountyHunterCharacter::CreatePauseMenuTabs() 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(); UpdateBountyTabInfo();
FavoursTab = CreateWidget<UTabWidget>(GetWorld(), FavoursTabWidgetClass); FavoursTab = CreateWidget<UTabWidget>(GetWorld(), FavoursTabWidgetClass);
NavigationTab = CreateWidget<UTabWidget>(GetWorld(), NavigationTabWidgetClass); NavigationTab = CreateWidget<UTabWidget>(GetWorld(), NavigationTabWidgetClass);
@ -141,3 +150,14 @@ void ABountyHunterCharacter::TogglePauseMenu()
PauseMenu->OpenedSettingsTab.AddDynamic(this, &ABountyHunterCharacter::OpenSettingsTab); PauseMenu->OpenedSettingsTab.AddDynamic(this, &ABountyHunterCharacter::OpenSettingsTab);
PauseMenu->OpenedQuitTab.AddDynamic(this, &ABountyHunterCharacter::OpenQuitTab); 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

@ -86,6 +86,14 @@ private:
UPROPERTY(EditDefaultsOnly, Category = "Pause Menu") UPROPERTY(EditDefaultsOnly, Category = "Pause Menu")
TSubclassOf<UBountiesTab> BountyTabWidgetClass; 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 // Reference to Bounty Tab Widget
UPROPERTY() UPROPERTY()
UBountiesTab* BountiesTab; UBountiesTab* BountiesTab;
@ -177,4 +185,7 @@ private:
BountiesTab->UpdateBountyTab(BountyTabInfo); BountiesTab->UpdateBountyTab(BountyTabInfo);
} }
UFUNCTION()
void ReturnToOpenWorldEarly();
}; };

View File

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