parent
e70d03fec5
commit
d9b81914dc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,22 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "MySessionListEntryWidget.h"
|
||||||
|
|
||||||
|
#include "OnlineSessionSettings.h"
|
||||||
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
|
#include "Components/TextBlock.h"
|
||||||
|
|
||||||
|
void UMySessionListEntryWidget::Update(int SessionIndex, const FOnlineSessionSearchResult& Session)
|
||||||
|
{
|
||||||
|
SessionId = SessionIndex;
|
||||||
|
IndexText->SetText(FText::AsNumber(SessionIndex + 1));
|
||||||
|
// TODO: SessionNameText->SetText(FText::FromString(Session.Session.SessionSettings.Get(...)))
|
||||||
|
SessionNameText->SetText(FText::FromString("Test session name"));
|
||||||
|
|
||||||
|
int MaxPlayerCount = Session.Session.SessionSettings.NumPublicConnections;
|
||||||
|
int CurPlayerCount = MaxPlayerCount - Session.Session.NumOpenPublicConnections;
|
||||||
|
|
||||||
|
PlayersCountText->SetText(FText::AsNumber(CurPlayerCount));
|
||||||
|
PingText->SetText(FText::AsNumber(Session.PingInMs));
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
|
#include "Blueprint/UserWidget.h"
|
||||||
|
#include "MySessionListEntryWidget.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class TURNBASEDTUTORIAL_API UMySessionListEntryWidget : public UUserWidget
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||||
|
class UTextBlock* IndexText;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||||
|
class UTextBlock* SessionNameText;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||||
|
class UTextBlock* PlayersCountText;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||||
|
class UTextBlock* PingText;
|
||||||
|
|
||||||
|
void Update(int SessionIndex, const FOnlineSessionSearchResult& Session);
|
||||||
|
|
||||||
|
int SessionId;
|
||||||
|
FString SessionName;
|
||||||
|
};
|
Loading…
Reference in new issue