Started UI rework
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#include "NakedDesireHUD.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "NakedDesire/UI/GameLayoutWidget.h"
|
||||
|
||||
void ANakedDesireHUD::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
GameLayoutWidget = CreateWidget<UGameLayoutWidget>(GetWorld(), GameLayoutWidgetClass);
|
||||
GameLayoutWidget->AddToViewport();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/HUD.h"
|
||||
#include "NakedDesireHUD.generated.h"
|
||||
|
||||
class UGameLayoutWidget;
|
||||
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API ANakedDesireHUD : public AHUD
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "UI")
|
||||
TSubclassOf<UGameLayoutWidget> GameLayoutWidgetClass;
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
private:
|
||||
UPROPERTY()
|
||||
TObjectPtr<UGameLayoutWidget> GameLayoutWidget;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
#include "GameLayoutWidget.h"
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CommonUserWidget.h"
|
||||
#include "GameLayoutWidget.generated.h"
|
||||
|
||||
class UHUDWidget;
|
||||
class UCommonActivatableWidgetStack;
|
||||
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UGameLayoutWidget : public UCommonUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<UCommonActivatableWidgetStack> WidgetStack;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<UHUDWidget> HUD;
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "HUDWidget.h"
|
||||
@@ -0,0 +1,16 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CommonUserWidget.h"
|
||||
#include "HUDWidget.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UHUDWidget : public UCommonUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
Reference in New Issue
Block a user