From 6a494261d77970071259e719cc35babbdb01f150 Mon Sep 17 00:00:00 2001 From: baz Date: Mon, 27 May 2024 20:32:03 +0100 Subject: [PATCH] Add SaveGameButton OnClick functionality --- Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset | 4 ++-- Content/UI/Pause/PauseMenu.uasset | 4 ++-- Source/Nakatomi/PauseUIWidget.cpp | 8 +++++++- Source/Nakatomi/PauseUIWidget.h | 6 ++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset b/Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset index 447c0fc..e22b50d 100644 --- a/Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset +++ b/Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:162ef4b23d1f1f22b30b3419fe6ee9c7bfd09ce26d1034eca166676e9a0e022e -size 38411 +oid sha256:7e17a0ff9818f61cd0422435ecf32d0fbf019778e50f406371a9ce55de3af5d6 +size 40389 diff --git a/Content/UI/Pause/PauseMenu.uasset b/Content/UI/Pause/PauseMenu.uasset index dadb30d..41dea91 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:f67bfeb7a089634e3d2611866453fc5e08c8ed1efcf3df063b410c0e7d646de8 -size 45074 +oid sha256:0bcedf550b25a6da0aa9758e54f503693792808709aa9e6c336eac1e13c9cab7 +size 63968 diff --git a/Source/Nakatomi/PauseUIWidget.cpp b/Source/Nakatomi/PauseUIWidget.cpp index c6a6dfb..dfaba03 100644 --- a/Source/Nakatomi/PauseUIWidget.cpp +++ b/Source/Nakatomi/PauseUIWidget.cpp @@ -3,6 +3,7 @@ #include "PauseUIWidget.h" +#include "NakatomiGameInstance.h" #include "Blueprint/WidgetBlueprintLibrary.h" #include "Kismet/GameplayStatics.h" @@ -105,7 +106,12 @@ void UPauseUIWidget::OptionsButtonOnClicked() void UPauseUIWidget::SaveButtonOnClicked() { - // TODO: Implement Functionality + UNakatomiGameInstance* gameInstance = Cast(UGameplayStatics::GetGameInstance(GetWorld())); + + if (gameInstance->SaveGame()) + { + PlayAnimation(SaveConfirmedAnimation, 0.0f, 1, EUMGSequencePlayMode::Forward, 1.0f); + } } void UPauseUIWidget::QuitButtonOnClicked() diff --git a/Source/Nakatomi/PauseUIWidget.h b/Source/Nakatomi/PauseUIWidget.h index cebebf7..112c8a0 100644 --- a/Source/Nakatomi/PauseUIWidget.h +++ b/Source/Nakatomi/PauseUIWidget.h @@ -36,6 +36,12 @@ public: UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UTextBlock* SaveTextBlock; + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) + UTextBlock* SaveConfirmedTextBlock; + + UPROPERTY(Transient, meta = (BindWidgetAnim)) + UWidgetAnimation* SaveConfirmedAnimation; + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UButton* QuitButton;