Add Options Menu to viewport on OptionsButton Clicked
This commit is contained in:
parent
dc0ed36573
commit
483add816a
Binary file not shown.
|
@ -60,6 +60,11 @@ void UPauseUIWidget::ResumeButtonOnClicked()
|
||||||
void UPauseUIWidget::OptionsButtonOnClicked()
|
void UPauseUIWidget::OptionsButtonOnClicked()
|
||||||
{
|
{
|
||||||
// TODO: Implement Functionality
|
// TODO: Implement Functionality
|
||||||
|
if (OptionsMenuWidget)
|
||||||
|
{
|
||||||
|
currentOptionsMenuWidget = CreateWidget<UUserWidget>(GetWorld(), OptionsMenuWidget);
|
||||||
|
currentOptionsMenuWidget->AddToViewport();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UPauseUIWidget::SaveButtonOnClicked()
|
void UPauseUIWidget::SaveButtonOnClicked()
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Blueprint/UserWidget.h"
|
#include "Blueprint/UserWidget.h"
|
||||||
#include "Components/Button.h"
|
#include "Components/Button.h"
|
||||||
#include "Components/VerticalBox.h"
|
|
||||||
#include "PauseUIWidget.generated.h"
|
#include "PauseUIWidget.generated.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,9 +16,6 @@ class NAKATOMI_API UPauseUIWidget : public UUserWidget
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
|
||||||
UVerticalBox* VerticalBox;
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||||
UButton* ResumeButton;
|
UButton* ResumeButton;
|
||||||
|
|
||||||
|
@ -35,6 +31,12 @@ public:
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||||
UButton* ExitGameButton;
|
UButton* ExitGameButton;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
|
TSubclassOf<class UUserWidget> OptionsMenuWidget;
|
||||||
|
|
||||||
|
private:
|
||||||
|
UUserWidget* currentOptionsMenuWidget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct() override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue