From 82a4951990e24bc112ec48e04c1c465ad4439b90 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Sun, 25 Feb 2024 08:57:20 +0000 Subject: [PATCH] Implemented Exiting Hover Bike along with its UI --- EndlessVendetta/Content/FirstPerson/BlueRoundedBox.png | 3 +++ .../Content/FirstPerson/BlueRoundedBox.uasset | 3 +++ .../Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../Content/FirstPerson/Blueprints/WBP_HoverBike.uasset | 3 +++ .../Content/FirstPerson/Input/Actions/IA_Interact.uasset | 4 ++-- EndlessVendetta/Content/Levels/MainMenuLevel.umap | 4 ++-- .../StarterContent/Architecture/Floor_400x400.uasset | 4 ++-- .../Blueprints/Blueprint_CeilingLight.uasset | 4 ++-- .../Source/EndlessVendetta/EndlessVendettaCharacter.cpp | 9 ++++++++- .../Source/EndlessVendetta/EndlessVendettaCharacter.h | 8 +++++++- 10 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 EndlessVendetta/Content/FirstPerson/BlueRoundedBox.png create mode 100644 EndlessVendetta/Content/FirstPerson/BlueRoundedBox.uasset create mode 100644 EndlessVendetta/Content/FirstPerson/Blueprints/WBP_HoverBike.uasset diff --git a/EndlessVendetta/Content/FirstPerson/BlueRoundedBox.png b/EndlessVendetta/Content/FirstPerson/BlueRoundedBox.png new file mode 100644 index 00000000..ef79b446 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/BlueRoundedBox.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93fa03fd268948cc2f092f18610ab9396c494ee74aff59c9d6b62d928a410dd1 +size 8423 diff --git a/EndlessVendetta/Content/FirstPerson/BlueRoundedBox.uasset b/EndlessVendetta/Content/FirstPerson/BlueRoundedBox.uasset new file mode 100644 index 00000000..2351549d --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/BlueRoundedBox.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db13efa8cae85c54ada7a18ebe5c194b76c0f6d5499ebd4e3f564adea7953088 +size 11936 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 722ba7d9..5a5b97f1 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2e738a26375c1724f07f3c945925628d9338c28057abedad8ec11cadc6198dae -size 475901 +oid sha256:4a8cd5f2950170a5c8d3f81f2ea301db959ec2dedd4c7cc4a0a9e56b589d092d +size 496806 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_HoverBike.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_HoverBike.uasset new file mode 100644 index 00000000..5b7f5320 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/WBP_HoverBike.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b6d8244909be465e5cc98adf7c6b1396c771ea6c738126494ee5d076000b77c +size 67488 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset index 2efaadb5..ff482195 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b268e7a4657dfa38394c03659fdcc2c5fe693ba5c88cf3b24782dfbd8a40d528 -size 1720 +oid sha256:cca4ee59c64913b578133d4ab472c7af05aff95ac285a87b3280857b6ff96d46 +size 1797 diff --git a/EndlessVendetta/Content/Levels/MainMenuLevel.umap b/EndlessVendetta/Content/Levels/MainMenuLevel.umap index a22b4a1e..0e852a64 100644 --- a/EndlessVendetta/Content/Levels/MainMenuLevel.umap +++ b/EndlessVendetta/Content/Levels/MainMenuLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:600196cb9c47d452e0d1601b378258b1a1d9e29bfde03128061d18057c3d8a6b -size 308710 +oid sha256:2f52ced25eaf47fd6bec920a4a9a8380202100076210df15ceba9ac577d7ef45 +size 308758 diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..23927787 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:09965370bba7fa07725b137e66efd7554d16b1c427c51ebab8e7f82e2f0a8355 +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index 066bc519..c5c3b84e 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:377425bb15b3107e87d7eb1c10673d59758fa7a27311a65bc613f28bef0c044b -size 43745 +oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 +size 158206 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 6f4d5e86..66473a96 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -216,6 +216,7 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* //Interacting EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Interact); EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::HoldInteract); + EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Canceled, this, &AEndlessVendettaCharacter::StoppedHoldingInteract); } } @@ -228,6 +229,7 @@ void AEndlessVendettaCharacter::Interact() Cast(GetComponentByClass(UAC_PlayerDialogueInterpreter::StaticClass()))->NextDialogue(); return; } + StartedHoldingInteract(1.f / HoldForInteractionDuration); if (PlayerOnShip) { SpaceShip->PlayerInteracting(); @@ -743,7 +745,12 @@ void AEndlessVendettaCharacter::UpdateInventorySize(int Cols, int Rows) void AEndlessVendettaCharacter::HoldInteract() { - if (PlayerOnShip || InPauseMenu) return; + if (InPauseMenu) return; + if (PlayerOnShip) + { + ExitShip(GetActorTransform()); + return; + } FTransform TakeOffTransform = GetActorTransform(); FVector NewLoc = TakeOffTransform.GetLocation(); NewLoc.Z += BikeRideHeight; diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 25e1f9ae..be4505c7 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -129,6 +129,7 @@ public: UPROPERTY(BlueprintReadWrite) bool bIsInDialogue = false; + protected: virtual void BeginPlay() override; virtual void Tick(float DeltaTime) override; @@ -228,7 +229,12 @@ protected: UPROPERTY(EditDefaultsOnly, Category = "Interaction") float InteractionRange = 250; void Interact(); - + UPROPERTY(EditDefaultsOnly, Category = "Interaction") + float HoldForInteractionDuration = 0.5f; + UFUNCTION(BlueprintImplementableEvent) + void StartedHoldingInteract(float Duration); + UFUNCTION(BlueprintImplementableEvent) + void StoppedHoldingInteract(); protected: // Used by vault it plugin to run vaulting animations USkeletalMeshComponent* FP_SkeletalMesh = nullptr;