From 9bb5e760f2d89c6b6189e6ea4b321af5c4045749 Mon Sep 17 00:00:00 2001 From: Ange-Marie MAURIN Date: Tue, 8 Jul 2025 18:24:26 +0200 Subject: [PATCH] Adding GetFormatedName() with Bib param --- Source/DTFluxUtilities/Private/FTDFluxUtils.cpp | 12 +++++++++++- Source/DTFluxUtilities/Public/FTDFluxUtils.h | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Source/DTFluxUtilities/Private/FTDFluxUtils.cpp b/Source/DTFluxUtilities/Private/FTDFluxUtils.cpp index 4d60f77..5830c17 100644 --- a/Source/DTFluxUtilities/Private/FTDFluxUtils.cpp +++ b/Source/DTFluxUtilities/Private/FTDFluxUtils.cpp @@ -3,7 +3,17 @@ #include "FTDFluxUtils.h" -FText UFTDFluxUtils::GetFormatedName(FDTFluxParticipant& Participant, const int MaxChar, const FString OverFlowChar) +#include "DTFluxCoreSubsystem.h" + +FText UFTDFluxUtils::GetFormatedName(const int& Bib, const int MaxChar, const FString OverFlowChar) +{ + UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem(); + const FDTFluxParticipant OutParticipant = CoreSubsystem->GetParticipant(Bib); + return OutParticipant.GetFormattedNameText(MaxChar, OverFlowChar); +} + +FText UFTDFluxUtils::GetParticipantFormatedName(FDTFluxParticipant& Participant, const int MaxChar, + const FString OverFlowChar) { return Participant.GetFormattedNameText(MaxChar, OverFlowChar); } diff --git a/Source/DTFluxUtilities/Public/FTDFluxUtils.h b/Source/DTFluxUtilities/Public/FTDFluxUtils.h index e70bb5e..20ac43d 100644 --- a/Source/DTFluxUtilities/Public/FTDFluxUtils.h +++ b/Source/DTFluxUtilities/Public/FTDFluxUtils.h @@ -17,6 +17,9 @@ class DTFLUXUTILITIES_API UFTDFluxUtils : public UBlueprintFunctionLibrary public: UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="name, concat, participant")) - static FText GetFormatedName(FDTFluxParticipant& Participant, const int MaxChar = 10, + static FText GetFormatedName(const int& Bib, const int MaxChar = 10, const FString OverFlowChar = "..."); + UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="name, concat, participant")) + static FText GetParticipantFormatedName(FDTFluxParticipant& Participant, const int MaxChar = 10, + const FString OverFlowChar = "..."); };