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()
|
||||
{
|
||||
// TODO: Implement Functionality
|
||||
if (OptionsMenuWidget)
|
||||
{
|
||||
currentOptionsMenuWidget = CreateWidget<UUserWidget>(GetWorld(), OptionsMenuWidget);
|
||||
currentOptionsMenuWidget->AddToViewport();
|
||||
}
|
||||
}
|
||||
|
||||
void UPauseUIWidget::SaveButtonOnClicked()
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "Components/Button.h"
|
||||
#include "Components/VerticalBox.h"
|
||||
#include "PauseUIWidget.generated.h"
|
||||
|
||||
/**
|
||||
|
@ -17,9 +16,6 @@ class NAKATOMI_API UPauseUIWidget : public UUserWidget
|
|||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UVerticalBox* VerticalBox;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UButton* ResumeButton;
|
||||
|
||||
|
@ -35,6 +31,12 @@ public:
|
|||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UButton* ExitGameButton;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
TSubclassOf<class UUserWidget> OptionsMenuWidget;
|
||||
|
||||
private:
|
||||
UUserWidget* currentOptionsMenuWidget;
|
||||
|
||||
public:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue