Create LoadGameUserWidget
This commit is contained in:
parent
82d2c21721
commit
0a302a8efa
|
@ -0,0 +1,26 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "../UI/LoadGameUserWidget.h"
|
||||
|
||||
void ULoadGameUserWidget::NativeConstruct()
|
||||
{
|
||||
Super::NativeConstruct();
|
||||
|
||||
if (CancelButton)
|
||||
{
|
||||
CancelButton->OnClicked.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonOnClicked);
|
||||
CancelButton->OnClicked.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayClickedSound);
|
||||
|
||||
CancelButton->OnHovered.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonHoveredDelegate);
|
||||
CancelButton->OnHovered.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayHoveredSound);
|
||||
|
||||
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonUnhoveredDelegate);
|
||||
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayUnhoveredSound);
|
||||
}
|
||||
}
|
||||
|
||||
void ULoadGameUserWidget::CancelButtonOnClicked()
|
||||
{
|
||||
ReturnToPreviousScreen();
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "NakatomiInteractiveWidget.h"
|
||||
#include "Components/Button.h"
|
||||
#include "Components/ScrollBox.h"
|
||||
#include "LoadGameUserWidget.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKATOMI_API ULoadGameUserWidget : public UNakatomiInteractiveWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UButton* CancelButton;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UTextBlock* CancelButtonTextBlock;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UScrollBox* SavedGamesScrollBox;
|
||||
|
||||
public:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
private:
|
||||
UFUNCTION()
|
||||
void CancelButtonOnClicked();
|
||||
|
||||
UFUNCTION()
|
||||
void CancelButtonHoveredDelegate() { SetTextBlockHovered(CancelButtonTextBlock); }
|
||||
|
||||
UFUNCTION()
|
||||
void CancelButtonUnhoveredDelegate() { SetTextBlockUnhovered(CancelButtonTextBlock); }
|
||||
};
|
Loading…
Reference in New Issue