diff --git a/Content/UI/Pause/PauseMenu.uasset b/Content/UI/Pause/PauseMenu.uasset index 9b8a765..78d522f 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:556e20cc22844d703fe870eb3e39208bbee0d3c0688639b2429aa6c1f166489f -size 40537 +oid sha256:8130233ef308500790815276831eb889fc815eb35e86f18344d2b14f4bf6e7cd +size 44912 diff --git a/Source/Nakatomi/PauseUIWidget.cpp b/Source/Nakatomi/PauseUIWidget.cpp index 81bf5fa..0cac343 100644 --- a/Source/Nakatomi/PauseUIWidget.cpp +++ b/Source/Nakatomi/PauseUIWidget.cpp @@ -13,32 +13,62 @@ void UPauseUIWidget::NativeConstruct() if (ResumeButton) { + ResumeButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::PlayClickedSound); ResumeButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::ResumeButtonOnClicked); + ResumeButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayHoveredSound); + ResumeButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::ResumeTextBlockHoveredDelegate); + + ResumeButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayUnhoveredSound); + ResumeButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::ResumeTextBlockUnhoveredDelegate); } if (OptionsButton) { + OptionsButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::PlayClickedSound); OptionsButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::OptionsButtonOnClicked); + OptionsButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayHoveredSound); + OptionsButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::OptionsTextBlockHoveredDelegate); + + OptionsButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayUnhoveredSound); + OptionsButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::OptionsTextBlockUnhoveredDelegate); } if (SaveButton) { + SaveButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::PlayClickedSound); SaveButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::SaveButtonOnClicked); + SaveButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayHoveredSound); + SaveButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::SaveTextBlockHoveredDelegate); + + SaveButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayUnhoveredSound); + SaveButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::SaveTextBlockUnhoveredDelegate); } if (QuitButton) { + QuitButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::PlayClickedSound); QuitButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::QuitButtonOnClicked); + QuitButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayHoveredSound); + QuitButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::QuitTextBlockHoveredDelegate); + + QuitButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayUnhoveredSound); + QuitButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::QuitTextBlockUnhoveredDelegate); } if (ExitGameButton) { + ExitGameButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::PlayClickedSound); ExitGameButton->OnClicked.AddUniqueDynamic(this, &UPauseUIWidget::ExitGameButtonOnClicked); + ExitGameButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayHoveredSound); + ExitGameButton->OnHovered.AddUniqueDynamic(this, &UPauseUIWidget::ExitGameTextBlockHoveredDelegate); + + ExitGameButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::PlayUnhoveredSound); + ExitGameButton->OnUnhovered.AddUniqueDynamic(this, &UPauseUIWidget::ExitGameTextBlockUnhoveredDelegate); } if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0)) diff --git a/Source/Nakatomi/PauseUIWidget.h b/Source/Nakatomi/PauseUIWidget.h index 27398d3..82d4201 100644 --- a/Source/Nakatomi/PauseUIWidget.h +++ b/Source/Nakatomi/PauseUIWidget.h @@ -21,18 +21,33 @@ public: UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UButton* ResumeButton; + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) + UTextBlock* ResumeTextBlock; + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UButton* OptionsButton; + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) + UTextBlock* OptionsTextBlock; + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UButton* SaveButton; + + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) + UTextBlock* SaveTextBlock; UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UButton* QuitButton; + + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) + UTextBlock* QuitTextBlock; UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UButton* ExitGameButton; - + + UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) + UTextBlock* ExitGameTextBlock; + UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) TSubclassOf OptionsMenuWidget; @@ -57,4 +72,34 @@ private: UFUNCTION() void ExitGameButtonOnClicked(); + + UFUNCTION() + void ResumeTextBlockHoveredDelegate() { SetTextBlockHovered(ResumeTextBlock); } + + UFUNCTION() + void ResumeTextBlockUnhoveredDelegate() { SetTextBlockUnhovered(ResumeTextBlock); } + + UFUNCTION() + void OptionsTextBlockHoveredDelegate() { SetTextBlockHovered(OptionsTextBlock); } + + UFUNCTION() + void OptionsTextBlockUnhoveredDelegate() { SetTextBlockUnhovered(OptionsTextBlock); } + + UFUNCTION() + void SaveTextBlockHoveredDelegate() { SetTextBlockHovered(SaveTextBlock); } + + UFUNCTION() + void SaveTextBlockUnhoveredDelegate() { SetTextBlockUnhovered(SaveTextBlock); } + + UFUNCTION() + void QuitTextBlockHoveredDelegate() { SetTextBlockHovered(QuitTextBlock); } + + UFUNCTION() + void QuitTextBlockUnhoveredDelegate() { SetTextBlockUnhovered(QuitTextBlock); } + + UFUNCTION() + void ExitGameTextBlockHoveredDelegate() { SetTextBlockHovered(ExitGameTextBlock); } + + UFUNCTION() + void ExitGameTextBlockUnhoveredDelegate() { SetTextBlockUnhovered(ExitGameTextBlock); } };