Compare commits
5 Commits
fdae0fddc8
...
6b58525349
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b58525349 | |||
| 505e4b7af2 | |||
| ae8b694f69 | |||
| a0b3ad6d8c | |||
| f644fb99a8 |
@ -108,7 +108,7 @@ struct FHierarchicalTreeItem
|
||||
Item->ContestId = InContestId;
|
||||
Item->SplitId = Split.SplitId;
|
||||
Item->ID = FString::Printf(TEXT("%d"), Split.SplitId);
|
||||
Item->Details = FString::Printf(TEXT("%d rankings"), Split.SplitRankings.Num());
|
||||
Item->Details = FString::Printf(TEXT("rankings"));
|
||||
Item->Status = TEXT("-");
|
||||
Item->Extra = TEXT("-");
|
||||
return Item;
|
||||
|
||||
@ -23,12 +23,7 @@ public:
|
||||
int SplitId = -1;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model", EditAnywhere)
|
||||
FString Name;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
|
||||
TArray<FDTFluxStageRanking> SplitRankings;
|
||||
// void Dump() const;
|
||||
// // void InsertOrReplace(const FDTFluxStageRankingResponseItem& SplitRankingItemResp);
|
||||
// void SortByRank();
|
||||
// TArray<FDTFluxSplitRanking> GetSplitRanking(const int From = 0, const int DisplayNumber = 0);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -31,5 +31,5 @@ public:
|
||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||
FString Gap = "-";
|
||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||
int Rank;
|
||||
int Rank = -1;
|
||||
};
|
||||
|
||||
@ -152,9 +152,9 @@ public:
|
||||
bool GetContests(TArray<FDTFluxContest>& OutContests);
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
void GetContest(const int ContestId, FDTFluxContest& OutContest);
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
UFUNCTION()
|
||||
bool GetStageDefinition(const FDTFluxStageKey StageKey, FDTFluxStage& OutStageDefinition);
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
UFUNCTION()
|
||||
bool GetSplitDefinition(const FDTFluxSplitKey SplitKey, FDTFluxSplit& OutSplitDefinition);
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
void GetStage(const int ContestId, const int StageId, FDTFluxStage& OutStageDefinition);
|
||||
|
||||
@ -4,14 +4,20 @@
|
||||
#include "FTDFluxUtils.h"
|
||||
|
||||
#include "DTFluxCoreSubsystem.h"
|
||||
#include "DTFluxUtilitiesModule.h"
|
||||
|
||||
FText UFTDFluxUtils::GetFormatedName(const int& Bib, const int MaxChar, const FString Separator,
|
||||
const FString OverFlowChar)
|
||||
{
|
||||
UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
||||
if (CoreSubsystem == nullptr)
|
||||
{
|
||||
FDTFluxParticipant OutParticipant;
|
||||
CoreSubsystem->GetParticipant(Bib, OutParticipant);
|
||||
return OutParticipant.GetFormattedNameText(MaxChar, Separator, OverFlowChar);
|
||||
}
|
||||
UE_LOG(logDTFluxUtilities, Error, TEXT("DTFluxCoreSubsystem not available"));
|
||||
return FText();
|
||||
}
|
||||
|
||||
FText UFTDFluxUtils::GetParticipantFormatedName(FDTFluxParticipant& Participant, const int MaxChar,
|
||||
@ -20,3 +26,33 @@ FText UFTDFluxUtils::GetParticipantFormatedName(FDTFluxParticipant& Participant,
|
||||
{
|
||||
return Participant.GetFormattedNameText(MaxChar, Separator, OverFlowChar);
|
||||
}
|
||||
|
||||
void UFTDFluxUtils::GetFullName(const int Bib, FText& OutFullName)
|
||||
{
|
||||
OutFullName = FText();
|
||||
UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
||||
FDTFluxParticipant Participant;
|
||||
CoreSubsystem->GetParticipant(Bib, Participant);
|
||||
{
|
||||
FDTFluxParticipant OutParticipant;
|
||||
if(CoreSubsystem->GetParticipant(Bib, OutParticipant))
|
||||
{
|
||||
FString FormattedName = "";
|
||||
if (OutParticipant.IsTeam())
|
||||
{
|
||||
OutFullName = FText::FromString(Participant.Team);
|
||||
return;
|
||||
}
|
||||
if (Participant.GetTeammate().IsEmpty())
|
||||
{
|
||||
UE_LOG(logDTFluxUtilities, Warning, TEXT("Non teammate found with Bib %i"), Bib)
|
||||
return;
|
||||
}
|
||||
OutFullName = FText::FromString(FString::Printf(TEXT("%s %s"), *Participant.GetTeammate()[0].FirstName,
|
||||
*Participant.GetTeammate()[0].LastName));
|
||||
return;
|
||||
}
|
||||
UE_LOG(logDTFluxUtilities, Warning, TEXT("Participant not found with Bib %i"), Bib);
|
||||
}
|
||||
UE_LOG(logDTFluxUtilities, Error, TEXT("DTFluxCoreSubsystem not available"));
|
||||
}
|
||||
|
||||
@ -66,4 +66,8 @@ public:
|
||||
OutRanking.Add(static_cast<T>(Item));
|
||||
}
|
||||
}
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Utils")
|
||||
static void GetFullName(const int Bib, FText& OutFullName);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user