Compare commits
No commits in common. "3a67e84072fd432af7eaef0baf458e522fc1486e" and "c941024ecf4d603a7086d8b982b6a98e6a42fced" have entirely different histories.
3a67e84072
...
c941024ecf
BIN
Content/UI/LoadGame/BP_LoadGameUserWidget.uasset (Stored with Git LFS)
BIN
Content/UI/LoadGame/BP_LoadGameUserWidget.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/UI/MainMenu/MainMenuUIWidget.uasset (Stored with Git LFS)
BIN
Content/UI/MainMenu/MainMenuUIWidget.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
#include "Blueprint/WidgetBlueprintLibrary.h"
|
#include "Blueprint/WidgetBlueprintLibrary.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "UI/LoadGameUserWidget.h"
|
|
||||||
|
|
||||||
void UMainMenuUIWidget::NativeConstruct()
|
void UMainMenuUIWidget::NativeConstruct()
|
||||||
{
|
{
|
||||||
|
@ -85,13 +84,7 @@ void UMainMenuUIWidget::NewGameButtonOnClicked()
|
||||||
|
|
||||||
void UMainMenuUIWidget::LoadGameButtonOnClicked()
|
void UMainMenuUIWidget::LoadGameButtonOnClicked()
|
||||||
{
|
{
|
||||||
if (LoadGameMenuWidget)
|
// TODO: Implement Functionality
|
||||||
{
|
|
||||||
currentLoadGameWidget = CreateWidget<ULoadGameUserWidget>(GetWorld(), LoadGameMenuWidget);
|
|
||||||
currentLoadGameWidget->AddToViewport();
|
|
||||||
currentLoadGameWidget->SetReturnScreen(this);
|
|
||||||
this->RemoveFromParent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMainMenuUIWidget::OptionsButtonOnClicked()
|
void UMainMenuUIWidget::OptionsButtonOnClicked()
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include "OptionsUIWidget.h"
|
#include "OptionsUIWidget.h"
|
||||||
#include "Blueprint/UserWidget.h"
|
#include "Blueprint/UserWidget.h"
|
||||||
#include "Components/Button.h"
|
#include "Components/Button.h"
|
||||||
#include "UI/LoadGameUserWidget.h"
|
|
||||||
#include "UI/NakatomiInteractiveWidget.h"
|
#include "UI/NakatomiInteractiveWidget.h"
|
||||||
#include "MainMenuUIWidget.generated.h"
|
#include "MainMenuUIWidget.generated.h"
|
||||||
|
|
||||||
|
@ -58,7 +57,7 @@ public:
|
||||||
private:
|
private:
|
||||||
UUserWidget* currentNewGameWidget;
|
UUserWidget* currentNewGameWidget;
|
||||||
|
|
||||||
ULoadGameUserWidget* currentLoadGameWidget;
|
UUserWidget* currentLoadGameWidget;
|
||||||
|
|
||||||
UOptionsUIWidget* currentOptionsMenuWidget;
|
UOptionsUIWidget* currentOptionsMenuWidget;
|
||||||
|
|
||||||
|
|
|
@ -109,9 +109,21 @@ void UOptionsUIWidget::NativeConstruct()
|
||||||
SetIsFocusable(true);
|
SetIsFocusable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UOptionsUIWidget::SetReturnScreen(UUserWidget* userWidget)
|
||||||
|
{
|
||||||
|
if (userWidget)
|
||||||
|
{
|
||||||
|
PreviousScreen = userWidget;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UOptionsUIWidget::BackButtonOnClicked()
|
void UOptionsUIWidget::BackButtonOnClicked()
|
||||||
{
|
{
|
||||||
ReturnToPreviousScreen();
|
// TODO: Implement Functionality
|
||||||
|
GEngine->GameUserSettings->ApplySettings(false);
|
||||||
|
|
||||||
|
this->RemoveFromParent();
|
||||||
|
PreviousScreen->AddToViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UOptionsUIWidget::ResetToDefaultsButtonOnClicked()
|
void UOptionsUIWidget::ResetToDefaultsButtonOnClicked()
|
||||||
|
|
|
@ -52,9 +52,15 @@ public:
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||||
UTextBlock* ResetToDefaultsTextBlock;
|
UTextBlock* ResetToDefaultsTextBlock;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
UUserWidget* PreviousScreen;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct() override;
|
||||||
|
|
||||||
|
void SetReturnScreen(UUserWidget* userWidget);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "../UI/LoadGameUserWidget.h"
|
|
||||||
|
|
||||||
void ULoadGameUserWidget::NativeConstruct()
|
|
||||||
{
|
|
||||||
Super::NativeConstruct();
|
|
||||||
|
|
||||||
if (CancelButton)
|
|
||||||
{
|
|
||||||
CancelButton->OnClicked.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonOnClicked);
|
|
||||||
CancelButton->OnClicked.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayClickedSound);
|
|
||||||
|
|
||||||
CancelButton->OnHovered.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonHoveredDelegate);
|
|
||||||
CancelButton->OnHovered.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayHoveredSound);
|
|
||||||
|
|
||||||
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonUnhoveredDelegate);
|
|
||||||
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayUnhoveredSound);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ULoadGameUserWidget::CancelButtonOnClicked()
|
|
||||||
{
|
|
||||||
ReturnToPreviousScreen();
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "NakatomiInteractiveWidget.h"
|
|
||||||
#include "Components/Button.h"
|
|
||||||
#include "Components/ScrollBox.h"
|
|
||||||
#include "LoadGameUserWidget.generated.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS()
|
|
||||||
class NAKATOMI_API ULoadGameUserWidget : public UNakatomiInteractiveWidget
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
|
||||||
UButton* CancelButton;
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
|
||||||
UTextBlock* CancelButtonTextBlock;
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
|
||||||
UScrollBox* SavedGamesScrollBox;
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void NativeConstruct() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
UFUNCTION()
|
|
||||||
void CancelButtonOnClicked();
|
|
||||||
|
|
||||||
UFUNCTION()
|
|
||||||
void CancelButtonHoveredDelegate() { SetTextBlockHovered(CancelButtonTextBlock); }
|
|
||||||
|
|
||||||
UFUNCTION()
|
|
||||||
void CancelButtonUnhoveredDelegate() { SetTextBlockUnhovered(CancelButtonTextBlock); }
|
|
||||||
};
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "../UI/NakatomiInteractiveWidget.h"
|
#include "../UI/NakatomiInteractiveWidget.h"
|
||||||
|
|
||||||
#include "GameFramework/GameUserSettings.h"
|
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
|
||||||
void UNakatomiInteractiveWidget::PlayHoveredSound()
|
void UNakatomiInteractiveWidget::PlayHoveredSound()
|
||||||
|
@ -39,20 +38,3 @@ void UNakatomiInteractiveWidget::PlayClickedSound()
|
||||||
UGameplayStatics::PlaySound2D(GetWorld(), ButtonUnhoveredSound);
|
UGameplayStatics::PlaySound2D(GetWorld(), ButtonUnhoveredSound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UNakatomiInteractiveWidget::ReturnToPreviousScreen()
|
|
||||||
{
|
|
||||||
// TODO: Implement Functionality
|
|
||||||
GEngine->GameUserSettings->ApplySettings(false);
|
|
||||||
|
|
||||||
this->RemoveFromParent();
|
|
||||||
PreviousScreen->AddToViewport();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UNakatomiInteractiveWidget::SetReturnScreen(UUserWidget* userWidget)
|
|
||||||
{
|
|
||||||
if (userWidget)
|
|
||||||
{
|
|
||||||
PreviousScreen = userWidget;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,14 +32,6 @@ public:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
USoundBase* ButtonClickedSound;
|
USoundBase* ButtonClickedSound;
|
||||||
|
|
||||||
protected:
|
|
||||||
UUserWidget* PreviousScreen;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
UFUNCTION()
|
|
||||||
void SetReturnScreen(UUserWidget* userWidget);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void PlayHoveredSound();
|
void PlayHoveredSound();
|
||||||
|
@ -56,6 +48,4 @@ protected:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void PlayClickedSound();
|
void PlayClickedSound();
|
||||||
|
|
||||||
UFUNCTION()
|
|
||||||
void ReturnToPreviousScreen();
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue