diff --git a/Source/Nakatomi/MainMenuUIWidget.cpp b/Source/Nakatomi/MainMenuUIWidget.cpp index 5f5a9cc..8aaabf6 100644 --- a/Source/Nakatomi/MainMenuUIWidget.cpp +++ b/Source/Nakatomi/MainMenuUIWidget.cpp @@ -3,6 +3,8 @@ #include "MainMenuUIWidget.h" +#include "Kismet/GameplayStatics.h" + void UMainMenuUIWidget::NativeConstruct() { Super::NativeConstruct(); @@ -30,7 +32,11 @@ void UMainMenuUIWidget::NativeConstruct() void UMainMenuUIWidget::NewGameButtonOnClicked() { - // TODO: Implement Functionality + // TODO: Replace this is a menu to confirm the user wants to start a new game + if (!NewGameLevel.IsNull()) + { + UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel); + } } void UMainMenuUIWidget::LoadGameButtonOnClicked() diff --git a/Source/Nakatomi/MainMenuUIWidget.h b/Source/Nakatomi/MainMenuUIWidget.h index 5658349..3124ba8 100644 --- a/Source/Nakatomi/MainMenuUIWidget.h +++ b/Source/Nakatomi/MainMenuUIWidget.h @@ -38,6 +38,9 @@ public: UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) TSubclassOf OptionsMenuWidget; + UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) + TSoftObjectPtr NewGameLevel; + private: UUserWidget* currentNewGameWidget;