From 50d017caa574f3889d883c1ec9f96b8e2f3aad30 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Thu, 8 Feb 2024 19:50:04 +0000 Subject: [PATCH] Bugfix Pause Menu not Focusing upon Construction --- .../.idea/.idea.EndlessVendetta/.idea/workspace.xml | 12 +++++------- .../Content/Dialogue/BP_DialogueUI.uasset | 4 ++-- .../Content/PauseMenu/WBP_PauseMenu.uasset | 4 ++-- .../StarterContent/Architecture/Floor_400x400.uasset | 4 ++-- .../StarterContent/Props/MaterialSphere.uasset | 4 ++-- .../Characters/BountyHunterCharacter.cpp | 11 ++++++++--- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml index d530d550..1bade766 100644 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml +++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml @@ -9,13 +9,11 @@ - - - - + + + + - - diff --git a/EndlessVendetta/Content/Dialogue/BP_DialogueUI.uasset b/EndlessVendetta/Content/Dialogue/BP_DialogueUI.uasset index 085864ef..a0bce40f 100644 --- a/EndlessVendetta/Content/Dialogue/BP_DialogueUI.uasset +++ b/EndlessVendetta/Content/Dialogue/BP_DialogueUI.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:35908c5dcdb5143afd98a83341d8cb46d90ab1430b3d365f1b4707d85c793c70 -size 224018 +oid sha256:288e87e29a4363ba187db4f6d9793a7d562d3e1b8f98917cf2aa06afcd296453 +size 222171 diff --git a/EndlessVendetta/Content/PauseMenu/WBP_PauseMenu.uasset b/EndlessVendetta/Content/PauseMenu/WBP_PauseMenu.uasset index 3d0c7902..d9e34568 100644 --- a/EndlessVendetta/Content/PauseMenu/WBP_PauseMenu.uasset +++ b/EndlessVendetta/Content/PauseMenu/WBP_PauseMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d08d2c22363938e76543ee9960bc2292c176ac79355269a17911ef0bbd3dc67b -size 484766 +oid sha256:64ca05e586e2efad00caccb8877e80ff186de099c7271b368fea7ed544606929 +size 485440 diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..12f5fcc3 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:a12f8ebb6bae23e00bebb19dc55243af89bcd8a40ec7c0de4fb6435e30c0ddb0 +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index 1d8c9235..56bddfc9 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:89eb1506e508685a1af663376434dabce0e1bcd54ea2832f7870a91eebf13749 -size 47710 +oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 +size 47333 diff --git a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp index 899cbd9f..b65da36f 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp @@ -127,21 +127,24 @@ void ABountyHunterCharacter::CreatePauseMenuTabs() void ABountyHunterCharacter::TogglePauseMenu() { const bool bOpenNewPauseMenu = !IsValid(PauseMenu); - FInputModeUIOnly UIOnly; + FInputModeGameAndUI UIAndGameOnly; FInputModeGameOnly GameOnly; APlayerController* PC = Cast(GetController()); - + InPauseMenu = bOpenNewPauseMenu; + + bOpenNewPauseMenu ? PC->SetInputMode(UIAndGameOnly) : PC->SetInputMode(GameOnly); PC->SetIgnoreMoveInput(bOpenNewPauseMenu); PC->SetIgnoreLookInput(bOpenNewPauseMenu); PC->SetShowMouseCursor(bOpenNewPauseMenu); + if (!bOpenNewPauseMenu) { PauseMenu->RemoveFromParent(); PauseMenu = nullptr; return; } - PauseMenu = CreateWidget(GetWorld(), PauseMenuWidgetClass); + PauseMenu = CreateWidget(GetWorld(), PauseMenuWidgetClass, FName("PauseMenu")); PauseMenu->AddToViewport(50); PauseMenu->OpenNewTab(BountiesTab); PauseMenu->OpenedBountiesTab.AddDynamic(this, &ABountyHunterCharacter::OpenBountiesTab); @@ -149,6 +152,8 @@ void ABountyHunterCharacter::TogglePauseMenu() PauseMenu->OpenedNavigationTab.AddDynamic(this, &ABountyHunterCharacter::OpenNavigationTab); PauseMenu->OpenedSettingsTab.AddDynamic(this, &ABountyHunterCharacter::OpenSettingsTab); PauseMenu->OpenedQuitTab.AddDynamic(this, &ABountyHunterCharacter::OpenQuitTab); + PauseMenu->SetVisibility(ESlateVisibility::Visible); + PauseMenu->SetFocus(); } void ABountyHunterCharacter::ReturnToOpenWorldEarly()