2026-03-31 07:42:56 -04:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "UI/Portal/Signin/SignInOverlay.h"
|
|
|
|
|
|
|
|
|
|
#include "Components/Button.h"
|
|
|
|
|
#include "UI/API/GameSessions/JoinGame.h"
|
|
|
|
|
#include "UI/Portal/PortalManager.h"
|
|
|
|
|
|
|
|
|
|
void USignInOverlay::NativeConstruct()
|
|
|
|
|
{
|
|
|
|
|
Super::NativeConstruct();
|
|
|
|
|
|
|
|
|
|
check(PortalManagerClass);
|
2026-04-02 22:01:25 -04:00
|
|
|
check(IsValid(JoinGameWidget));
|
|
|
|
|
check(IsValid(JoinGameWidget->Button_JoinGame));
|
|
|
|
|
PortalManager = NewObject<UPortalManager>(this, PortalManagerClass);
|
2026-03-31 08:15:28 -04:00
|
|
|
|
|
|
|
|
JoinGameWidget->Button_JoinGame->OnClicked.AddDynamic(this, &USignInOverlay::OnJoinGameButtonClicked);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void USignInOverlay::OnJoinGameButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
check (IsValid(PortalManager));
|
2026-04-02 22:01:25 -04:00
|
|
|
check(IsValid(JoinGameWidget));
|
|
|
|
|
check(IsValid(JoinGameWidget->Button_JoinGame));
|
2026-03-31 08:15:28 -04:00
|
|
|
|
|
|
|
|
PortalManager->BroadcastJoinGameSessionMessage.AddDynamic(this, &USignInOverlay::UpdateJoinGameStatusMessage);
|
|
|
|
|
PortalManager->JoinGameSession();
|
|
|
|
|
JoinGameWidget->Button_JoinGame->SetIsEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void USignInOverlay::UpdateJoinGameStatusMessage(const FString& StatusMessage)
|
|
|
|
|
{
|
2026-04-02 22:01:25 -04:00
|
|
|
check(IsValid(JoinGameWidget));
|
2026-03-31 08:15:28 -04:00
|
|
|
JoinGameWidget->SetStatusMessage(StatusMessage);
|
2026-03-31 07:42:56 -04:00
|
|
|
}
|