Lesson 67 - Portal Setup
This commit is contained in:
Binary file not shown.
BIN
Content/DedicatedServers/Portal/BP_PortalHUD.uasset
Normal file
BIN
Content/DedicatedServers/Portal/BP_PortalHUD.uasset
Normal file
Binary file not shown.
BIN
Content/DedicatedServers/Portal/BP_PortalManager.uasset
Normal file
BIN
Content/DedicatedServers/Portal/BP_PortalManager.uasset
Normal file
Binary file not shown.
BIN
Content/DedicatedServers/Portal/WBP_JoinGame.uasset
Normal file
BIN
Content/DedicatedServers/Portal/WBP_JoinGame.uasset
Normal file
Binary file not shown.
BIN
Content/DedicatedServers/Portal/WBP_SignInOverlay.uasset
Normal file
BIN
Content/DedicatedServers/Portal/WBP_SignInOverlay.uasset
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "UI/API/GameSessions/JoinGame.h"
|
||||||
23
Source/DedicatedServers/Private/UI/Portal/PortalHUD.cpp
Normal file
23
Source/DedicatedServers/Private/UI/Portal/PortalHUD.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "UI/Portal/PortalHUD.h"
|
||||||
|
#include "UI/Portal/SignIn/SignInOverlay.h"
|
||||||
|
#include "Blueprint/UserWidget.h"
|
||||||
|
|
||||||
|
void APortalHUD::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
APlayerController* OwningPlayerController = GetOwningPlayerController();
|
||||||
|
SignInOverlay = CreateWidget<USignInOverlay>(OwningPlayerController, SignInOverlayClass);
|
||||||
|
if (IsValid(SignInOverlay))
|
||||||
|
{
|
||||||
|
SignInOverlay->AddToViewport();
|
||||||
|
}
|
||||||
|
|
||||||
|
const FInputModeGameAndUI InputModeData;
|
||||||
|
OwningPlayerController->SetInputMode(InputModeData);
|
||||||
|
OwningPlayerController->SetShowMouseCursor(true);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "UI/Portal/PortalManager.h"
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "UI/Portal/SignIn/SignInOverlay.h"
|
||||||
|
|
||||||
|
#include "UI/Portal/PortalManager.h"
|
||||||
|
|
||||||
|
void USignInOverlay::NativeConstruct()
|
||||||
|
{
|
||||||
|
Super::NativeConstruct();
|
||||||
|
check(PortalManagerClass);
|
||||||
|
|
||||||
|
PortalManager = NewObject<UPortalManager>(PortalManagerClass);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "Blueprint/UserWidget.h"
|
||||||
|
#include "JoinGame.generated.h"
|
||||||
|
|
||||||
|
class UButton;
|
||||||
|
class UTextBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class DEDICATEDSERVERS_API UJoinGame : public UUserWidget
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
UPROPERTY(meta = (BindWidget))
|
||||||
|
TObjectPtr<UButton> Button_JoinGame;
|
||||||
|
|
||||||
|
UPROPERTY(meta = (BindWidget))
|
||||||
|
TObjectPtr<UTextBlock> TextBlock_StatusMessage;
|
||||||
|
};
|
||||||
32
Source/DedicatedServers/Public/UI/Portal/PortalHUD.h
Normal file
32
Source/DedicatedServers/Public/UI/Portal/PortalHUD.h
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/HUD.h"
|
||||||
|
#include "PortalHUD.generated.h"
|
||||||
|
|
||||||
|
class USignInOverlay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class DEDICATEDSERVERS_API APortalHUD : public AHUD
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
TSubclassOf<USignInOverlay> SignInOverlayClass;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
TObjectPtr<USignInOverlay> SignInOverlay;
|
||||||
|
};
|
||||||
16
Source/DedicatedServers/Public/UI/Portal/PortalManager.h
Normal file
16
Source/DedicatedServers/Public/UI/Portal/PortalManager.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 "UI/HTTP/HTTPRequestManager.h"
|
||||||
|
#include "PortalManager.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class DEDICATEDSERVERS_API UPortalManager : public UHTTPRequestManager
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
};
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "Blueprint/UserWidget.h"
|
||||||
|
#include "SignInOverlay.generated.h"
|
||||||
|
|
||||||
|
class UJoinGame;
|
||||||
|
class UPortalManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class DEDICATEDSERVERS_API USignInOverlay : public UUserWidget
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
UPROPERTY(meta = (BindWidget))
|
||||||
|
TObjectPtr<UJoinGame> JoinGameWidget;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
TSubclassOf<UPortalManager> PortalManagerClass;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void NativeConstruct() override;
|
||||||
|
private:
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
TObjectPtr<UPortalManager> PortalManager;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user