Add Quit Button functionality
This commit is contained in:
parent
66367ca165
commit
e50d8701fd
BIN
Content/UI/Pause/PauseMenu.uasset (Stored with Git LFS)
BIN
Content/UI/Pause/PauseMenu.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -110,7 +110,19 @@ void UPauseUIWidget::SaveButtonOnClicked()
|
|||
|
||||
void UPauseUIWidget::QuitButtonOnClicked()
|
||||
{
|
||||
// TODO: Implement Functionality
|
||||
// TODO: Replace this is a menu to confirm the user wants to start a new game
|
||||
if (!MainMenuLevel.IsNull())
|
||||
{
|
||||
UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), MainMenuLevel);
|
||||
}
|
||||
|
||||
if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
||||
{
|
||||
UWidgetBlueprintLibrary::SetInputMode_UIOnlyEx(PlayerController, this, EMouseLockMode::LockAlways);
|
||||
PlayerController->bShowMouseCursor = true;
|
||||
}
|
||||
|
||||
SetIsFocusable(true);
|
||||
}
|
||||
|
||||
void UPauseUIWidget::ExitGameButtonOnClicked()
|
||||
|
|
|
@ -51,6 +51,9 @@ public:
|
|||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
TSubclassOf<class UUserWidget> OptionsMenuWidget;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
TSoftObjectPtr<UWorld> MainMenuLevel;
|
||||
|
||||
private:
|
||||
UOptionsUIWidget* currentOptionsMenuWidget;
|
||||
|
||||
|
|
Loading…
Reference in New Issue