2026-03-26 21:38:50 -04:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "UI/APITest/APITestOverlay.h"
|
2026-03-29 07:54:19 -04:00
|
|
|
|
|
|
|
|
#include "Components/Button.h"
|
|
|
|
|
#include "UI/API/ListFleets/ListFleetsBox.h"
|
|
|
|
|
#include "UI/APITest/APITestManager.h"
|
|
|
|
|
|
|
|
|
|
void UAPITestOverlay::NativeConstruct()
|
|
|
|
|
{
|
|
|
|
|
Super::NativeConstruct();
|
|
|
|
|
|
|
|
|
|
check(APITestManagerClass);
|
|
|
|
|
APITestManager = NewObject<UAPITestManager>(this, APITestManagerClass);
|
|
|
|
|
|
|
|
|
|
check(ListFleetsBox)
|
|
|
|
|
check(ListFleetsBox->Button_ListFleets)
|
2026-03-30 17:30:24 -04:00
|
|
|
ListFleetsBox->Button_ListFleets->OnClicked.AddDynamic(this, &UAPITestOverlay::ListFleetsButtonClicked);
|
2026-03-29 07:54:19 -04:00
|
|
|
|
|
|
|
|
}
|
2026-03-30 17:30:24 -04:00
|
|
|
|
|
|
|
|
void UAPITestOverlay::ListFleetsButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
check (APITestManager)
|
|
|
|
|
APITestManager->OnListFleetsResponseReceived.AddDynamic(this, &UAPITestOverlay::OnListFleetsResponseReceived);
|
|
|
|
|
APITestManager->ListFleets();
|
|
|
|
|
ListFleetsBox->Button_ListFleets->SetIsEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UAPITestOverlay::OnListFleetsResponseReceived(const FDSListFleetsResponse& ListFleetsResponse, bool bWasSuccessful)
|
|
|
|
|
{
|
|
|
|
|
if (bWasSuccessful)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
ListFleetsBox->Button_ListFleets->SetIsEnabled(true);
|
|
|
|
|
}
|