Space Plunder
Loading...
Searching...
No Matches
ULeaderboardEntryWidget Class Reference

#include <LeaderboardEntryWidget.h>

Inheritance diagram for ULeaderboardEntryWidget:

Public Member Functions

void SetLeaderboardEntry (const FSteamLeaderboardEntry &LeaderboardEntry, const ESteamAvatarSize AvatarSize)
 
void OnLeaderboardEntrySet (const FSteamLeaderboardEntry &LeaderboardEntry, const ESteamAvatarSize AvatarSize)
 
void SetPlayerImage (UTexture2D *Texture)
 

Protected Member Functions

virtual bool Initialize () override
 
virtual void NativeConstruct () override
 

Protected Attributes

class UImage * PlayerImage
 
class UTextBlock * NameTextBlock
 
class UTextBlock * RankTextBlock
 
class UTextBlock * ScoreTextBlock
 

Member Function Documentation

◆ Initialize()

bool ULeaderboardEntryWidget::Initialize ( )
overrideprotectedvirtual
10{
11 const bool bSuccess = Super::Initialize();
12 if (!ensure(PlayerImage != nullptr)) return false;
13 if (!ensure(NameTextBlock != nullptr)) return false;
14 if (!ensure(RankTextBlock != nullptr)) return false;
15 if (!ensure(ScoreTextBlock != nullptr)) return false;
16 if(!bSuccess) return false;
17 return true;
18}
class UTextBlock * NameTextBlock
Definition LeaderboardEntryWidget.h:36
class UTextBlock * ScoreTextBlock
Definition LeaderboardEntryWidget.h:40
class UImage * PlayerImage
Definition LeaderboardEntryWidget.h:34
class UTextBlock * RankTextBlock
Definition LeaderboardEntryWidget.h:38

◆ NativeConstruct()

void ULeaderboardEntryWidget::NativeConstruct ( )
overrideprotectedvirtual
21{
22 Super::NativeConstruct();
23
24}

◆ OnLeaderboardEntrySet()

void ULeaderboardEntryWidget::OnLeaderboardEntrySet ( const FSteamLeaderboardEntry & LeaderboardEntry,
const ESteamAvatarSize AvatarSize )

◆ SetLeaderboardEntry()

void ULeaderboardEntryWidget::SetLeaderboardEntry ( const FSteamLeaderboardEntry & LeaderboardEntry,
const ESteamAvatarSize AvatarSize )
27{
28 const FText FormattedRank = FText::Format(NSLOCTEXT("","","#{0}"),
29 FText::AsNumber(LeaderboardEntry.Rank));
30 RankTextBlock->SetText(FormattedRank);
31 ScoreTextBlock->SetText(FText::AsNumber(LeaderboardEntry.Score));
32 NameTextBlock->SetText(FText::FromString(LeaderboardEntry.User));
33 OnLeaderboardEntrySet(LeaderboardEntry, AvatarSize);
34}
void OnLeaderboardEntrySet(const FSteamLeaderboardEntry &LeaderboardEntry, const ESteamAvatarSize AvatarSize)
int32 Score
Definition LeaderboardData.h:21
int32 Rank
Definition LeaderboardData.h:15
FString User
Definition LeaderboardData.h:19

◆ SetPlayerImage()

void ULeaderboardEntryWidget::SetPlayerImage ( UTexture2D * Texture)
37{
38 PlayerImage->SetBrushFromTexture(Texture);
39}

Member Data Documentation

◆ NameTextBlock

class UTextBlock* ULeaderboardEntryWidget::NameTextBlock
protected

◆ PlayerImage

class UImage* ULeaderboardEntryWidget::PlayerImage
protected

◆ RankTextBlock

class UTextBlock* ULeaderboardEntryWidget::RankTextBlock
protected

◆ ScoreTextBlock

class UTextBlock* ULeaderboardEntryWidget::ScoreTextBlock
protected

The documentation for this class was generated from the following files: