diff --git a/Content/UI/TestWidget.uasset b/Content/UI/TestWidget.uasset new file mode 100644 index 0000000..16aa394 --- /dev/null +++ b/Content/UI/TestWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21cde54bba4a2ee8d8c908616a4932e8ad0c0dc78394d47d551854ac0631b171 +size 24683 diff --git a/Source/Nakatomi/PauseUIWidget.cpp b/Source/Nakatomi/PauseUIWidget.cpp index 7287885..08ff11c 100644 --- a/Source/Nakatomi/PauseUIWidget.cpp +++ b/Source/Nakatomi/PauseUIWidget.cpp @@ -60,6 +60,11 @@ void UPauseUIWidget::ResumeButtonOnClicked() void UPauseUIWidget::OptionsButtonOnClicked() { // TODO: Implement Functionality + if (OptionsMenuWidget) + { + currentOptionsMenuWidget = CreateWidget(GetWorld(), OptionsMenuWidget); + currentOptionsMenuWidget->AddToViewport(); + } } void UPauseUIWidget::SaveButtonOnClicked() diff --git a/Source/Nakatomi/PauseUIWidget.h b/Source/Nakatomi/PauseUIWidget.h index f23e3af..c58d7bd 100644 --- a/Source/Nakatomi/PauseUIWidget.h +++ b/Source/Nakatomi/PauseUIWidget.h @@ -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 OptionsMenuWidget; + +private: + UUserWidget* currentOptionsMenuWidget; + public: virtual void NativeConstruct() override;