From 7c7fb0db019dc216115fd6a128dff95927d0fadc Mon Sep 17 00:00:00 2001 From: MarcelHara Date: Sat, 13 May 2023 17:58:13 +0100 Subject: [PATCH] Updated TempCharacter to fix merchant exit bug and cached escapemenu --- Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp | 10 ++++++---- Source/the_twilight_abyss/PlayerTemp/TempCharacter.h | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index c97a2cf..d67f3d0 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -50,13 +50,13 @@ void ATempCharacter::BeginPlay() CrossHairWidget->SetVisibility(ESlateVisibility::Visible); CrossHairWidget->AddToViewport(); - // ImportantStatsWidget = CreateWidget(GetWorld(), ImportantStatsSub); - // ImportantStatsWidget->SetVisibility(ESlateVisibility::Visible); - // ImportantStatsWidget->AddToViewport(); - InventoryWidget = CreateWidget(GetWorld(), InventoryMenuSub); InventoryWidget->SetVisibility(ESlateVisibility::Hidden); InventoryWidget->AddToViewport(); + + EscapeMenuWidget = CreateWidget(GetWorld(), EscapeMenuSub); + EscapeMenuWidget->SetVisibility(ESlateVisibility::Hidden); + EscapeMenuWidget->AddToViewport(); } //Binds the input we made in the setup player component to the forward vector @@ -278,6 +278,8 @@ void ATempCharacter::InputEnabler() APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); PlayerController->SetInputMode(FInputModeGameOnly()); PlayerController->bShowMouseCursor = false; + PlayerController->SetIgnoreMoveInput(false); + PlayerController->SetIgnoreLookInput(false); UE_LOG(LogTemp, Display, TEXT("Enabling Inputs")); disableTab = true; diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index 34d6aac..57e55b9 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -120,6 +120,9 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets") UUserWidget* InventoryWidget; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets") + UUserWidget* EscapeMenuWidget; UPROPERTY(EditAnywhere, Category= "Widgets") TSubclassOf ImportantStatsSub; @@ -127,6 +130,9 @@ public: UPROPERTY(EditAnywhere, Category= "Widgets") TSubclassOf InventoryMenuSub; + UPROPERTY(EditAnywhere, Category= "Widgets") + TSubclassOf EscapeMenuSub; + UPROPERTY(EditAnywhere, Category= "Widgets") TSubclassOf CrossHairSub;