diff --git a/Content/UI/Pause/PauseMenu.uasset b/Content/UI/Pause/PauseMenu.uasset index 78d522f..dadb30d 100644 --- a/Content/UI/Pause/PauseMenu.uasset +++ b/Content/UI/Pause/PauseMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8130233ef308500790815276831eb889fc815eb35e86f18344d2b14f4bf6e7cd -size 44912 +oid sha256:f67bfeb7a089634e3d2611866453fc5e08c8ed1efcf3df063b410c0e7d646de8 +size 45074 diff --git a/Source/Nakatomi/PauseUIWidget.cpp b/Source/Nakatomi/PauseUIWidget.cpp index 0cac343..c6a6dfb 100644 --- a/Source/Nakatomi/PauseUIWidget.cpp +++ b/Source/Nakatomi/PauseUIWidget.cpp @@ -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() diff --git a/Source/Nakatomi/PauseUIWidget.h b/Source/Nakatomi/PauseUIWidget.h index 82d4201..cebebf7 100644 --- a/Source/Nakatomi/PauseUIWidget.h +++ b/Source/Nakatomi/PauseUIWidget.h @@ -51,6 +51,9 @@ public: UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) TSubclassOf OptionsMenuWidget; + UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) + TSoftObjectPtr MainMenuLevel; + private: UOptionsUIWidget* currentOptionsMenuWidget;