Compare commits
2 Commits
449687d7ee
...
1f6d729d73
Author | SHA1 | Date |
---|---|---|
baz | 1f6d729d73 | |
baz | 085fd8ea46 |
BIN
Content/UI/MainMenu/MainMenuUIWidget.uasset (Stored with Git LFS)
BIN
Content/UI/MainMenu/MainMenuUIWidget.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "MainMenuUIWidget.h"
|
#include "MainMenuUIWidget.h"
|
||||||
|
|
||||||
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
|
||||||
void UMainMenuUIWidget::NativeConstruct()
|
void UMainMenuUIWidget::NativeConstruct()
|
||||||
{
|
{
|
||||||
Super::NativeConstruct();
|
Super::NativeConstruct();
|
||||||
|
@ -30,7 +32,11 @@ void UMainMenuUIWidget::NativeConstruct()
|
||||||
|
|
||||||
void UMainMenuUIWidget::NewGameButtonOnClicked()
|
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()
|
void UMainMenuUIWidget::LoadGameButtonOnClicked()
|
||||||
|
@ -40,7 +46,13 @@ void UMainMenuUIWidget::LoadGameButtonOnClicked()
|
||||||
|
|
||||||
void UMainMenuUIWidget::OptionsButtonOnClicked()
|
void UMainMenuUIWidget::OptionsButtonOnClicked()
|
||||||
{
|
{
|
||||||
// TODO: Implement Functionality
|
if (OptionsMenuWidget)
|
||||||
|
{
|
||||||
|
currentOptionsMenuWidget = CreateWidget<UOptionsUIWidget>(GetWorld(), OptionsMenuWidget);
|
||||||
|
currentOptionsMenuWidget->AddToViewport();
|
||||||
|
currentOptionsMenuWidget->SetReturnScreen(this);
|
||||||
|
this->RemoveFromParent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMainMenuUIWidget::QuitButtonOnClicked()
|
void UMainMenuUIWidget::QuitButtonOnClicked()
|
||||||
|
|
|
@ -38,6 +38,9 @@ public:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
TSubclassOf<class UUserWidget> OptionsMenuWidget;
|
TSubclassOf<class UUserWidget> OptionsMenuWidget;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
|
TSoftObjectPtr<UWorld> NewGameLevel;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UUserWidget* currentNewGameWidget;
|
UUserWidget* currentNewGameWidget;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue