Updated TempCharacter to fix merchant exit bug and cached escapemenu

This commit is contained in:
MarcelHara 2023-05-13 17:58:13 +01:00
parent b446ba7691
commit 7c7fb0db01
2 changed files with 12 additions and 4 deletions

View File

@ -50,13 +50,13 @@ void ATempCharacter::BeginPlay()
CrossHairWidget->SetVisibility(ESlateVisibility::Visible);
CrossHairWidget->AddToViewport();
// ImportantStatsWidget = CreateWidget<UUserWidget>(GetWorld(), ImportantStatsSub);
// ImportantStatsWidget->SetVisibility(ESlateVisibility::Visible);
// ImportantStatsWidget->AddToViewport();
InventoryWidget = CreateWidget<UUserWidget>(GetWorld(), InventoryMenuSub);
InventoryWidget->SetVisibility(ESlateVisibility::Hidden);
InventoryWidget->AddToViewport();
EscapeMenuWidget = CreateWidget<UUserWidget>(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;

View File

@ -121,12 +121,18 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* InventoryWidget;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* EscapeMenuWidget;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> ImportantStatsSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> InventoryMenuSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> EscapeMenuSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> CrossHairSub;