Add SaveGameButton OnClick functionality

This commit is contained in:
baz 2024-05-27 20:32:03 +01:00
parent 6e822f88b0
commit 6a494261d7
4 changed files with 17 additions and 5 deletions

Binary file not shown.

BIN
Content/UI/Pause/PauseMenu.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -3,6 +3,7 @@
#include "PauseUIWidget.h" #include "PauseUIWidget.h"
#include "NakatomiGameInstance.h"
#include "Blueprint/WidgetBlueprintLibrary.h" #include "Blueprint/WidgetBlueprintLibrary.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
@ -105,7 +106,12 @@ void UPauseUIWidget::OptionsButtonOnClicked()
void UPauseUIWidget::SaveButtonOnClicked() void UPauseUIWidget::SaveButtonOnClicked()
{ {
// TODO: Implement Functionality UNakatomiGameInstance* gameInstance = Cast<UNakatomiGameInstance>(UGameplayStatics::GetGameInstance(GetWorld()));
if (gameInstance->SaveGame())
{
PlayAnimation(SaveConfirmedAnimation, 0.0f, 1, EUMGSequencePlayMode::Forward, 1.0f);
}
} }
void UPauseUIWidget::QuitButtonOnClicked() void UPauseUIWidget::QuitButtonOnClicked()

View File

@ -36,6 +36,12 @@ public:
UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
UTextBlock* SaveTextBlock; UTextBlock* SaveTextBlock;
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
UTextBlock* SaveConfirmedTextBlock;
UPROPERTY(Transient, meta = (BindWidgetAnim))
UWidgetAnimation* SaveConfirmedAnimation;
UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
UButton* QuitButton; UButton* QuitButton;