Lession 56 - API Test HUD
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
CommonUI.Debug.CheckGameViewportClientValid=0
|
||||
|
||||
[/Script/EngineSettings.GameMapsSettings]
|
||||
GameDefaultMap=/Game/ThirdPerson/Maps/ThirdPersonMap.ThirdPersonMap
|
||||
EditorStartupMap=/Game/ThirdPerson/Maps/ThirdPersonMap.ThirdPersonMap
|
||||
GameDefaultMap=/Game/Maps/StartupMap.StartupMap
|
||||
EditorStartupMap=/Game/Maps/StartupMap.StartupMap
|
||||
GlobalDefaultGameMode=/Game/Blueprints/Game/BP_ShooterGameModeBase.BP_ShooterGameModeBase_C
|
||||
ServerDefaultMap=/Game/ThirdPerson/Maps/ThirdPersonMap.ThirdPersonMap
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Content/DedicatedServers/APITest/UI/BP_APITestHUD.uasset
Normal file
BIN
Content/DedicatedServers/APITest/UI/BP_APITestHUD.uasset
Normal file
Binary file not shown.
BIN
Content/DedicatedServers/APITest/UI/WBP_APITestOverlay.uasset
Normal file
BIN
Content/DedicatedServers/APITest/UI/WBP_APITestOverlay.uasset
Normal file
Binary file not shown.
@@ -21,7 +21,8 @@ public class DedicatedServers : ModuleRules
|
||||
{
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"OpenSSL"
|
||||
"OpenSSL",
|
||||
"UMG"
|
||||
});
|
||||
|
||||
// Adds in the plugin for GameLiftServerSDK if it is the server build.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "UI/API_Test/APITestOverlay.h"
|
||||
17
Source/DedicatedServers/Private/UI/API_Test/API_TestHUD.cpp
Normal file
17
Source/DedicatedServers/Private/UI/API_Test/API_TestHUD.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "UI/API_Test/API_TestHUD.h"
|
||||
#include "UI/API_Test/APITestOverlay.h"
|
||||
|
||||
void AAPI_TestHUD::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
APlayerController* PlayerController = GetOwningPlayerController();
|
||||
if (IsValid(PlayerController) && APITestOverlayClass)
|
||||
{
|
||||
APITestOverlay = CreateWidget<UAPITestOverlay>(PlayerController, APITestOverlayClass);
|
||||
APITestOverlay->AddToViewport();
|
||||
}
|
||||
}
|
||||
16
Source/DedicatedServers/Public/UI/API_Test/APITestOverlay.h
Normal file
16
Source/DedicatedServers/Public/UI/API_Test/APITestOverlay.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "APITestOverlay.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class DEDICATEDSERVERS_API UAPITestOverlay : public UUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
29
Source/DedicatedServers/Public/UI/API_Test/API_TestHUD.h
Normal file
29
Source/DedicatedServers/Public/UI/API_Test/API_TestHUD.h
Normal file
@@ -0,0 +1,29 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/HUD.h"
|
||||
#include "API_TestHUD.generated.h"
|
||||
|
||||
class UAPITestOverlay;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class DEDICATEDSERVERS_API AAPI_TestHUD : public AHUD
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
TSubclassOf<UAPITestOverlay> APITestOverlayClass;
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
private:
|
||||
UPROPERTY()
|
||||
TObjectPtr<UAPITestOverlay> APITestOverlay;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user