Compare commits

...

5 Commits

3 changed files with 25 additions and 19 deletions

View File

@ -150,7 +150,9 @@ int FDTFluxParticipant::GetTeammateNum() const
bool FDTFluxParticipant::IsTeam() const bool FDTFluxParticipant::IsTeam() const
{ {
return Teammate.Num() > 1; UE_LOG(logDTFluxCore, Verbose, TEXT("IsTeam() -> %s, Teamate Num %i"),
Team.IsEmpty() ? TEXT("TRUE") : TEXT("FALSE"), Teammate.Num());
return !Team.IsEmpty();
} }
const TArray<FDTFluxPerson>& FDTFluxParticipant::GetTeammate() const const TArray<FDTFluxPerson>& FDTFluxParticipant::GetTeammate() const
@ -165,13 +167,18 @@ FString FDTFluxParticipant::GetFormattedName(const int MaxChar, const FString& S
{ {
return TEXT(""); return TEXT("");
} }
FString FirstName;
FString LastName; if (Teammate.Num() == 0)
{
return "";
}
if (IsTeam()) if (IsTeam())
{ {
FString FullName;
UE_LOG(logDTFluxCore, Verbose, TEXT("Participant is a team"));
if (!Team.IsEmpty()) if (!Team.IsEmpty())
{ {
LastName = Team; FullName = Team;
} }
else else
{ {
@ -180,24 +187,23 @@ FString FDTFluxParticipant::GetFormattedName(const int MaxChar, const FString& S
{ {
Names.Add(Person.LastName); Names.Add(Person.LastName);
} }
LastName = FString::Join(Names, TEXT("/")); FullName = FString::Join(Names, TEXT("/"));
} }
} FullName = FullName.ToUpper();
else if (Teammate.Num() > 0) if (FullName.Len() <= MaxChar)
{ {
FirstName = Teammate[0].FirstName; return FullName;
LastName = Teammate[0].LastName;
} }
else return FullName.Left(MaxChar) + OverflowChar;
{
LastName = TEXT("Unknown");
} }
FString FirstName = Teammate[0].FirstName;
FString LastName = Teammate[0].LastName;
FString Initial; FString Initial;
if (!FirstName.IsEmpty()) if (!FirstName.IsEmpty())
{ {
Initial = FirstName.Left(1).ToUpper() + Separator; Initial = FirstName.Left(1).ToUpper() + Separator;
} }
FString FormattedLastName = LastName.ToUpper(); const FString FormattedLastName = LastName.ToUpper();
FString FullName = Initial + FormattedLastName; FString FullName = Initial + FormattedLastName;
if (FullName.Len() <= MaxChar) if (FullName.Len() <= MaxChar)
{ {

View File

@ -35,13 +35,13 @@ public:
UPROPERTY(BlueprintReadOnly, EditAnywhere) UPROPERTY(BlueprintReadOnly, EditAnywhere)
TMap<FString /* ContestName */, FDTFluxContest> Contests; TMap<FString /* ContestName */, FDTFluxContest> Contests;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere) UPROPERTY(BlueprintReadOnly, EditAnywhere)
TMap<int /*ContestId*/, FDTFluxContestRankings> ContestRankings; TMap<int /*ContestId*/, FDTFluxContestRankings> ContestRankings;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere) UPROPERTY(BlueprintReadOnly, EditAnywhere)
TMap<FDTFluxStageKey, FDTFluxStageRankings> StageRankings; TMap<FDTFluxStageKey, FDTFluxStageRankings> StageRankings;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere) UPROPERTY(BlueprintReadOnly, EditAnywhere)
TMap<FDTFluxSplitKey, FDTFluxSplitRankings> SplitRankings; TMap<FDTFluxSplitKey, FDTFluxSplitRankings> SplitRankings;
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|ModelAsset") UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|ModelAsset")

View File

@ -31,5 +31,5 @@ public:
UPROPERTY(BlueprintReadOnly, VisibleAnywhere) UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
FString Gap = "-"; FString Gap = "-";
UPROPERTY(BlueprintReadOnly, VisibleAnywhere) UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
int Rank; int Rank = -1;
}; };