Added Blank Delegate for split Sensors + Added Getters for Contest/Stage/Split rankings for 1 participant + Global Cleaning
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
#include "Widget/DTFluxAssetModelDetailsWidget.h"
|
#include "Widget/DTFluxAssetModelDetailsWidget.h"
|
||||||
|
|
||||||
|
#include "DTFluxAssetsEditorModule.h"
|
||||||
#include "Widgets/Layout/SBorder.h"
|
#include "Widgets/Layout/SBorder.h"
|
||||||
#include "Widgets/Layout/SBox.h"
|
#include "Widgets/Layout/SBox.h"
|
||||||
#include "Widgets/Text/STextBlock.h"
|
#include "Widgets/Text/STextBlock.h"
|
||||||
@ -23,19 +24,19 @@ TSharedRef<SWidget> SHierarchicalTreeItemRow::GenerateWidgetForColumn(const FNam
|
|||||||
{
|
{
|
||||||
if (!Item.IsValid())
|
if (!Item.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("GenerateWidgetForColumn: Invalid item for column %s"), *ColumnName.ToString());
|
// UE_LOG(logDTFluxAssetEditor, Warning, TEXT("GenerateWidgetForColumn: Invalid item for column %s"), *ColumnName.ToString());
|
||||||
return SNew(STextBlock).Text(FText::FromString("Invalid Item"));
|
return SNew(STextBlock).Text(FText::FromString("Invalid Item"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ParentWidget)
|
if (!ParentWidget)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("GenerateWidgetForColumn: Invalid ParentWidget for column %s"),
|
// UE_LOG(logDTFluxAssetEditor, Warning, TEXT("GenerateWidgetForColumn: Invalid ParentWidget for column %s"),
|
||||||
*ColumnName.ToString());
|
// *ColumnName.ToString());
|
||||||
return SNew(STextBlock).Text(FText::FromString("Invalid Parent"));
|
return SNew(STextBlock).Text(FText::FromString("Invalid Parent"));
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, VeryVerbose, TEXT("GenerateWidgetForColumn: %s for item %s"),
|
// UE_LOG(logDTFluxAssetEditor, VeryVerbose, TEXT("GenerateWidgetForColumn: %s for item %s"),
|
||||||
*ColumnName.ToString(), *Item->Name);
|
// *ColumnName.ToString(), *Item->Name);
|
||||||
|
|
||||||
if (ColumnName == "Name")
|
if (ColumnName == "Name")
|
||||||
{
|
{
|
||||||
@ -93,7 +94,7 @@ TSharedRef<SWidget> SHierarchicalTreeItemRow::GenerateWidgetForColumn(const FNam
|
|||||||
.OverflowPolicy(ETextOverflowPolicy::Ellipsis);
|
.OverflowPolicy(ETextOverflowPolicy::Ellipsis);
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Warning, TEXT("GenerateWidgetForColumn: Unknown column %s"), *ColumnName.ToString());
|
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("GenerateWidgetForColumn: Unknown column %s"), *ColumnName.ToString());
|
||||||
return SNew(STextBlock).Text(FText::FromString(FString::Printf(TEXT("Unknown: %s"), *ColumnName.ToString())));
|
return SNew(STextBlock).Text(FText::FromString(FString::Printf(TEXT("Unknown: %s"), *ColumnName.ToString())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +412,7 @@ void SDTFluxAssetModelDetailsWidget::BuildContestHierarchy()
|
|||||||
RootItems.Add(ContestItem);
|
RootItems.Add(ContestItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("Built contest hierarchy with %d root contests"), RootItems.Num());
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Built contest hierarchy with %d root contests"), RootItems.Num());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
||||||
@ -420,11 +421,11 @@ void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
|||||||
|
|
||||||
if (!ModelAsset)
|
if (!ModelAsset)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("BuildParticipantList: ModelAsset is null!"));
|
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("BuildParticipantList: ModelAsset is null!"));
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("BuildParticipantList: ModelAsset has %d participants"), ModelAsset->Participants.Num());
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("BuildParticipantList: ModelAsset has %d participants"), ModelAsset->Participants.Num());
|
||||||
|
|
||||||
// Créer la liste des participants (pas de hiérarchie pour les participants)
|
// Créer la liste des participants (pas de hiérarchie pour les participants)
|
||||||
for (const auto& ParticipantPair : ModelAsset->Participants)
|
for (const auto& ParticipantPair : ModelAsset->Participants)
|
||||||
@ -433,12 +434,12 @@ void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
|||||||
auto ParticipantItem = FHierarchicalTreeItem::CreateParticipant(Participant);
|
auto ParticipantItem = FHierarchicalTreeItem::CreateParticipant(Participant);
|
||||||
ParticipantItems.Add(ParticipantItem);
|
ParticipantItems.Add(ParticipantItem);
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("BuildParticipantList: Added participant %s (Bib: %d)"),
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("BuildParticipantList: Added participant %s (Bib: %d)"),
|
||||||
*ParticipantItem->Name, ParticipantItem->Bib);
|
// *ParticipantItem->Name, ParticipantItem->Bib);
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("BuildParticipantList: Built participant list with %d participants"),
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("BuildParticipantList: Built participant list with %d participants"),
|
||||||
ParticipantItems.Num());
|
// ParticipantItems.Num());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== CALLBACKS TREEVIEW =====
|
// ===== CALLBACKS TREEVIEW =====
|
||||||
@ -448,12 +449,12 @@ TSharedRef<ITableRow> SDTFluxAssetModelDetailsWidget::OnGenerateRowForTree(
|
|||||||
{
|
{
|
||||||
if (!Item.IsValid())
|
if (!Item.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("OnGenerateRowForTree: Invalid item!"));
|
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("OnGenerateRowForTree: Invalid item!"));
|
||||||
return SNew(STableRow<FHierarchicalTreeItemPtr>, OwnerTable);
|
return SNew(STableRow<FHierarchicalTreeItemPtr>, OwnerTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("OnGenerateRowForTree: Generating row for %s (Type: %d)"),
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("OnGenerateRowForTree: Generating row for %s (Type: %d)"),
|
||||||
*Item->Name, (int32)Item->Type);
|
// *Item->Name, (int32)Item->Type);
|
||||||
|
|
||||||
return SNew(SHierarchicalTreeItemRow, OwnerTable)
|
return SNew(SHierarchicalTreeItemRow, OwnerTable)
|
||||||
.Item(Item)
|
.Item(Item)
|
||||||
@ -536,7 +537,7 @@ FReply SDTFluxAssetModelDetailsWidget::OnExpandAllClicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("Expanded all contests"));
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Expanded all contests"));
|
||||||
return FReply::Handled();
|
return FReply::Handled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,14 +551,14 @@ FReply SDTFluxAssetModelDetailsWidget::OnCollapseAllClicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("Collapsed all contests"));
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Collapsed all contests"));
|
||||||
return FReply::Handled();
|
return FReply::Handled();
|
||||||
}
|
}
|
||||||
|
|
||||||
FReply SDTFluxAssetModelDetailsWidget::OnRefreshClicked()
|
FReply SDTFluxAssetModelDetailsWidget::OnRefreshClicked()
|
||||||
{
|
{
|
||||||
RefreshData();
|
RefreshData();
|
||||||
UE_LOG(LogTemp, Log, TEXT("Data refreshed"));
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Data refreshed"));
|
||||||
return FReply::Handled();
|
return FReply::Handled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,21 +568,17 @@ void SDTFluxAssetModelDetailsWidget::RefreshData()
|
|||||||
{
|
{
|
||||||
if (!ModelAsset)
|
if (!ModelAsset)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("ModelAsset is null!"));
|
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("ModelAsset is null!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(LogTemp, Log, TEXT("RefreshData: Starting refresh for ModelAsset %s"), *ModelAsset->GetName());
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("RefreshData: Starting refresh for ModelAsset %s"), *ModelAsset->GetName());
|
||||||
|
|
||||||
// Nettoyer les données existantes
|
|
||||||
RootItems.Empty();
|
RootItems.Empty();
|
||||||
ParticipantItems.Empty();
|
ParticipantItems.Empty();
|
||||||
|
|
||||||
// Construire la hiérarchie
|
|
||||||
BuildContestHierarchy();
|
BuildContestHierarchy();
|
||||||
BuildParticipantList();
|
BuildParticipantList();
|
||||||
|
|
||||||
// Refresh les vues
|
|
||||||
if (ContestTreeView.IsValid())
|
if (ContestTreeView.IsValid())
|
||||||
{
|
{
|
||||||
ContestTreeView->RequestTreeRefresh();
|
ContestTreeView->RequestTreeRefresh();
|
||||||
@ -591,9 +588,8 @@ void SDTFluxAssetModelDetailsWidget::RefreshData()
|
|||||||
{
|
{
|
||||||
ParticipantTreeView->RequestTreeRefresh();
|
ParticipantTreeView->RequestTreeRefresh();
|
||||||
}
|
}
|
||||||
|
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("RefreshData: Completed successfully - %d contests, %d participants"), RootItems.Num(),
|
||||||
UE_LOG(LogTemp, Log, TEXT("RefreshData: Completed successfully - %d contests, %d participants"), RootItems.Num(),
|
// ParticipantItems.Num());
|
||||||
ParticipantItems.Num());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== MÉTHODES UTILITAIRES =====
|
// ===== MÉTHODES UTILITAIRES =====
|
||||||
@ -635,7 +631,6 @@ FText SDTFluxAssetModelDetailsWidget::GetStatsText() const
|
|||||||
{
|
{
|
||||||
if (!ModelAsset)
|
if (!ModelAsset)
|
||||||
return FText::FromString("No data");
|
return FText::FromString("No data");
|
||||||
|
|
||||||
return FText::FromString(FString::Printf(
|
return FText::FromString(FString::Printf(
|
||||||
TEXT("Contests: [%d] Participants: [%d] Persons: [%d]"),
|
TEXT("Contests: [%d] Participants: [%d] Persons: [%d]"),
|
||||||
ModelAsset->Contests.Num(),
|
ModelAsset->Contests.Num(),
|
||||||
|
|||||||
@ -137,7 +137,7 @@ struct FHierarchicalTreeItem
|
|||||||
typedef TSharedPtr<FHierarchicalTreeItem> FHierarchicalTreeItemPtr;
|
typedef TSharedPtr<FHierarchicalTreeItem> FHierarchicalTreeItemPtr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Widget avec STreeView simple et efficace
|
* ModelAsset TreeviewWidget
|
||||||
*/
|
*/
|
||||||
class DTFLUXASSETSEDITOR_API SDTFluxAssetModelDetailsWidget : public SCompoundWidget
|
class DTFLUXASSETSEDITOR_API SDTFluxAssetModelDetailsWidget : public SCompoundWidget
|
||||||
{
|
{
|
||||||
@ -152,40 +152,33 @@ public:
|
|||||||
void Construct(const FArguments& InArgs);
|
void Construct(const FArguments& InArgs);
|
||||||
void RefreshData();
|
void RefreshData();
|
||||||
|
|
||||||
// Méthodes publiques pour la sous-classe Row
|
|
||||||
FSlateColor GetItemTypeColor(FHierarchicalTreeItem::EItemType Type) const;
|
FSlateColor GetItemTypeColor(FHierarchicalTreeItem::EItemType Type) const;
|
||||||
const FSlateBrush* GetItemIcon(FHierarchicalTreeItem::EItemType Type) const;
|
const FSlateBrush* GetItemIcon(FHierarchicalTreeItem::EItemType Type) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Données
|
|
||||||
UDTFluxModelAsset* ModelAsset = nullptr;
|
UDTFluxModelAsset* ModelAsset = nullptr;
|
||||||
TArray<FHierarchicalTreeItemPtr> RootItems; // Contests racines avec hiérarchie
|
TArray<FHierarchicalTreeItemPtr> RootItems;
|
||||||
TArray<FHierarchicalTreeItemPtr> ParticipantItems; // Participants séparés
|
TArray<FHierarchicalTreeItemPtr> ParticipantItems;
|
||||||
|
|
||||||
// Widgets - TreeView simple
|
|
||||||
TSharedPtr<STreeView<FHierarchicalTreeItemPtr>> ContestTreeView;
|
TSharedPtr<STreeView<FHierarchicalTreeItemPtr>> ContestTreeView;
|
||||||
TSharedPtr<STreeView<FHierarchicalTreeItemPtr>> ParticipantTreeView;
|
TSharedPtr<STreeView<FHierarchicalTreeItemPtr>> ParticipantTreeView;
|
||||||
TSharedPtr<STextBlock> StatsText;
|
TSharedPtr<STextBlock> StatsText;
|
||||||
TSharedPtr<STextBlock> SelectionText;
|
TSharedPtr<STextBlock> SelectionText;
|
||||||
|
|
||||||
// Méthodes de construction
|
|
||||||
void BuildContestHierarchy();
|
void BuildContestHierarchy();
|
||||||
void BuildParticipantList();
|
void BuildParticipantList();
|
||||||
|
|
||||||
// Callbacks TreeView
|
|
||||||
TSharedRef<ITableRow> OnGenerateRowForTree(FHierarchicalTreeItemPtr Item,
|
TSharedRef<ITableRow> OnGenerateRowForTree(FHierarchicalTreeItemPtr Item,
|
||||||
const TSharedRef<STableViewBase>& OwnerTable);
|
const TSharedRef<STableViewBase>& OwnerTable);
|
||||||
void OnGetChildrenForTree(FHierarchicalTreeItemPtr Item, TArray<FHierarchicalTreeItemPtr>& OutChildren);
|
void OnGetChildrenForTree(FHierarchicalTreeItemPtr Item, TArray<FHierarchicalTreeItemPtr>& OutChildren);
|
||||||
void OnTreeSelectionChanged(FHierarchicalTreeItemPtr SelectedItem, ESelectInfo::Type SelectInfo);
|
void OnTreeSelectionChanged(FHierarchicalTreeItemPtr SelectedItem, ESelectInfo::Type SelectInfo);
|
||||||
void OnSetExpansionRecursive(FHierarchicalTreeItemPtr Item, bool bIsExpanded);
|
void OnSetExpansionRecursive(FHierarchicalTreeItemPtr Item, bool bIsExpanded);
|
||||||
|
|
||||||
// Callbacks des boutons
|
|
||||||
FReply OnRefreshClicked();
|
FReply OnRefreshClicked();
|
||||||
FReply OnExpandAllClicked();
|
FReply OnExpandAllClicked();
|
||||||
FReply OnCollapseAllClicked();
|
FReply OnCollapseAllClicked();
|
||||||
|
|
||||||
EActiveTimerReturnType ForceInitialLayout(double InCurrentTime, float InDeltaTime);
|
EActiveTimerReturnType ForceInitialLayout(double InCurrentTime, float InDeltaTime);
|
||||||
|
|
||||||
// Utilitaires
|
|
||||||
FText GetStatsText() const;
|
FText GetStatsText() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -24,17 +24,17 @@ enum class EDTFluxParticipantStatusType : uint8
|
|||||||
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
|
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
|
||||||
enum class EParticipantSortingType : uint8
|
enum class EParticipantSortingType : uint8
|
||||||
{
|
{
|
||||||
|
|
||||||
None = 0 << 1 UMETA(DisplayName="Normal"),
|
None = 0 << 1 UMETA(DisplayName="Normal"),
|
||||||
Alpha = 1 << 1 UMETA(DisplayName="Aplha"),
|
Alpha = 1 << 1 UMETA(DisplayName="Aplha"),
|
||||||
PoursuiteStartTime = 1 << 2 UMETA(DisplayName="Poursuite StartTime"),
|
PoursuiteStartTime = 1 << 2 UMETA(DisplayName="Poursuite StartTime"),
|
||||||
Rank = 1 << 3 UMETA(DisplayName="Rank"),
|
Rank = 1 << 3 UMETA(DisplayName="Rank"),
|
||||||
IgnoreEmpty = 1 << 4 UMETA(DisplayName="IgnoreEmpty"),
|
IgnoreEmpty = 1 << 4 UMETA(DisplayName="IgnoreEmpty"),
|
||||||
};
|
};
|
||||||
|
|
||||||
ENUM_CLASS_FLAGS(EParticipantSortingType);
|
ENUM_CLASS_FLAGS(EParticipantSortingType);
|
||||||
|
|
||||||
|
|
||||||
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
|
UENUM(BlueprintType)
|
||||||
enum class EDTFluxFinisherType : uint8
|
enum class EDTFluxFinisherType : uint8
|
||||||
{
|
{
|
||||||
None = 0b0000000 UMETA(DisplayName="Unknown"),
|
None = 0b0000000 UMETA(DisplayName="Unknown"),
|
||||||
@ -42,7 +42,6 @@ enum class EDTFluxFinisherType : uint8
|
|||||||
Winner = 0b0000010 UMETA(DisplayName="Winner"),
|
Winner = 0b0000010 UMETA(DisplayName="Winner"),
|
||||||
Spotter = 0b0000100 UMETA(DisplayName="Spotter"),
|
Spotter = 0b0000100 UMETA(DisplayName="Spotter"),
|
||||||
};
|
};
|
||||||
ENUM_CLASS_FLAGS(EDTFluxFinisherType);
|
|
||||||
|
|
||||||
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
|
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
|
||||||
enum class EDTFluxSplitType : uint8
|
enum class EDTFluxSplitType : uint8
|
||||||
@ -52,6 +51,7 @@ enum class EDTFluxSplitType : uint8
|
|||||||
Finish = 0b00000010 UMETA(DisplayName="FinishSplit"),
|
Finish = 0b00000010 UMETA(DisplayName="FinishSplit"),
|
||||||
Regular = 0b00000100 UMETA(DisplayName="Regular"),
|
Regular = 0b00000100 UMETA(DisplayName="Regular"),
|
||||||
};
|
};
|
||||||
|
|
||||||
ENUM_CLASS_FLAGS(EDTFluxSplitType);
|
ENUM_CLASS_FLAGS(EDTFluxSplitType);
|
||||||
|
|
||||||
|
|
||||||
@ -67,8 +67,9 @@ enum class EDTFluxSortingFilter : uint8
|
|||||||
ByAlpha = 0b01000000 UMETA(DisplayName="ByAlpha"),
|
ByAlpha = 0b01000000 UMETA(DisplayName="ByAlpha"),
|
||||||
ByStartTime = 0b00100000 UMETA(DisplayName="ByStartTime"),
|
ByStartTime = 0b00100000 UMETA(DisplayName="ByStartTime"),
|
||||||
AscendingByRank = Ascending | ByRank UMETA(DisplayName="AscendingByRank"),
|
AscendingByRank = Ascending | ByRank UMETA(DisplayName="AscendingByRank"),
|
||||||
DescendingByRank= Descending | ByRank UMETA(DisplayName="DescendingByRank")
|
DescendingByRank = Descending | ByRank UMETA(DisplayName="DescendingByRank")
|
||||||
};
|
};
|
||||||
|
|
||||||
ENUM_CLASS_FLAGS(EDTFluxSortingFilter);
|
ENUM_CLASS_FLAGS(EDTFluxSortingFilter);
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +81,7 @@ enum class EDTFluxSortingRankingType: uint8
|
|||||||
Bib = 0b00000010 UMETA(DisplayName="Bib"),
|
Bib = 0b00000010 UMETA(DisplayName="Bib"),
|
||||||
TimeSwim = 0b00000100 UMETA(DisplayName="Swimming Time"),
|
TimeSwim = 0b00000100 UMETA(DisplayName="Swimming Time"),
|
||||||
TimeTransition = 0b00001000 UMETA(DisplayName="Transition Time"),
|
TimeTransition = 0b00001000 UMETA(DisplayName="Transition Time"),
|
||||||
TimeRun = TimeSwim|TimeTransition UMETA(DisplayName="Running Time"),
|
TimeRun = TimeSwim | TimeTransition UMETA(DisplayName="Running Time"),
|
||||||
StartTime = 0b00001110 UMETA(DisplayName="StartTime"),
|
StartTime = 0b00001110 UMETA(DisplayName="StartTime"),
|
||||||
Gap = 0b00010000 UMETA(DisplayName="StartTime"),
|
Gap = 0b00010000 UMETA(DisplayName="StartTime"),
|
||||||
SwimSpeed = 0b00100000 UMETA(DisplayName="StartTime"),
|
SwimSpeed = 0b00100000 UMETA(DisplayName="StartTime"),
|
||||||
|
|||||||
@ -15,6 +15,7 @@ USTRUCT(BlueprintType, Category="DTFlux|Model")
|
|||||||
struct DTFLUXCORE_API FDTFluxFinisherData
|
struct DTFLUXCORE_API FDTFluxFinisherData
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||||
int ContestId;
|
int ContestId;
|
||||||
@ -23,9 +24,7 @@ public:
|
|||||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||||
int Bib = -1;
|
int Bib = -1;
|
||||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||||
FDTFluxStageRanking SplitRanking;
|
FString Time;
|
||||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
|
||||||
FDTFluxStageRanking StageRanking;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
USTRUCT(BlueprintType, Category="FDTFlux|Model")
|
USTRUCT(BlueprintType, Category="FDTFlux|Model")
|
||||||
@ -64,4 +63,3 @@ struct DTFLUXCORE_API FDTFluxContestFinished
|
|||||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
||||||
TArray<FDTFluxStageRanking> Rankings;
|
TArray<FDTFluxStageRanking> Rankings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @struct FDTFluxStageRanking
|
* @struct FDTFluxDetailedRankingItem
|
||||||
* Representing a stage ranking for a participant
|
* Representing a stage ranking for a participant
|
||||||
*/
|
*/
|
||||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||||
@ -125,7 +125,7 @@ struct FDTFluxStageRanking : public FDTFluxDetailedRankingItem
|
|||||||
* This struct is only a cosmetic Struct
|
* This struct is only a cosmetic Struct
|
||||||
*/
|
*/
|
||||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||||
struct DTFLUXCORE_API FDTFluxSplitRanking : public FDTFluxStageRanking
|
struct DTFLUXCORE_API FDTFluxSplitRanking : public FDTFluxDetailedRankingItem
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
};
|
};
|
||||||
|
|||||||
@ -32,6 +32,4 @@ public:
|
|||||||
FString Gap = "-";
|
FString Gap = "-";
|
||||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||||
int Rank;
|
int Rank;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -288,6 +288,76 @@ void UDTFluxCoreSubsystem::SendRequest(const FString& Message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UDTFluxCoreSubsystem::GetStageRankingForBib(const int ContestId, const int StageId, const int Bib,
|
||||||
|
FDTFluxStageRanking& OutStageRanking)
|
||||||
|
{
|
||||||
|
if (DataStorage)
|
||||||
|
{
|
||||||
|
FDTFluxStageKey StageKey(ContestId, StageId);
|
||||||
|
if (DataStorage->StageRankings.Contains(StageKey))
|
||||||
|
{
|
||||||
|
FDTFluxStageRankings StageRankings = DataStorage->StageRankings[StageKey];
|
||||||
|
for (auto& Ranking : StageRankings.Rankings)
|
||||||
|
{
|
||||||
|
if (Ranking.Bib == Bib)
|
||||||
|
{
|
||||||
|
OutStageRanking = static_cast<FDTFluxStageRanking>(Ranking);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Unable to find StageRanking for Bib %i"), Bib);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
UE_LOG(logDTFluxCoreSubsystem, Error, TEXT("DataStorage not available"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UDTFluxCoreSubsystem::GetSplitRankingForBib(const int ContestId, const int StageId, const int SplitId,
|
||||||
|
const int Bib, FDTFluxSplitRanking& OutSplitRankings)
|
||||||
|
{
|
||||||
|
if (DataStorage)
|
||||||
|
{
|
||||||
|
FDTFluxSplitKey SplitKey(ContestId, StageId, SplitId);
|
||||||
|
if (DataStorage->SplitRankings.Contains(SplitKey))
|
||||||
|
{
|
||||||
|
FDTFluxSplitRankings SplitRankings = DataStorage->SplitRankings[SplitKey];
|
||||||
|
for (auto& Ranking : SplitRankings.Rankings)
|
||||||
|
{
|
||||||
|
if (Ranking.Bib == Bib)
|
||||||
|
{
|
||||||
|
OutSplitRankings = static_cast<FDTFluxSplitRanking>(Ranking);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Unable to find SplitRanking for Bib %i"), Bib);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
UE_LOG(logDTFluxCoreSubsystem, Error, TEXT("DataStorage not available"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UDTFluxCoreSubsystem::GetContestRanking(const int ContestId, FDTFluxContestRanking& OutContestRanking)
|
||||||
|
{
|
||||||
|
if (DataStorage)
|
||||||
|
{
|
||||||
|
FDTFluxContest Contest;
|
||||||
|
if (GetContestForId(ContestId, Contest))
|
||||||
|
{
|
||||||
|
for (auto& Ranking : DataStorage->ContestRankings[ContestId].Rankings)
|
||||||
|
{
|
||||||
|
OutContestRanking = Ranking;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Unable to find ContestRanking for ContestId %i"), ContestId);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
UE_LOG(logDTFluxCoreSubsystem, Error, TEXT("DataStorage not available"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool UDTFluxCoreSubsystem::GetContestRankings(const int ContestId,
|
bool UDTFluxCoreSubsystem::GetContestRankings(const int ContestId,
|
||||||
FDTFluxContestRankings& OutContestRankings)
|
FDTFluxContestRankings& OutContestRankings)
|
||||||
{
|
{
|
||||||
@ -468,13 +538,15 @@ TArray<FGuid> UDTFluxCoreSubsystem::TrackedRequestSplitRankings(const TArray<FDT
|
|||||||
return TArray<FGuid>();
|
return TArray<FGuid>();
|
||||||
}
|
}
|
||||||
|
|
||||||
const FDTFluxParticipant UDTFluxCoreSubsystem::GetParticipant(int InBib)
|
bool UDTFluxCoreSubsystem::GetParticipant(int InBib, FDTFluxParticipant& OutParticipant)
|
||||||
{
|
{
|
||||||
if (DataStorage->Participants.Contains(InBib))
|
if (DataStorage->Participants.Contains(InBib))
|
||||||
{
|
{
|
||||||
return DataStorage->Participants[InBib];
|
OutParticipant = DataStorage->Participants[InBib];
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return FDTFluxParticipant();
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<int> UDTFluxCoreSubsystem::GetCurrentContestsId()
|
TArray<int> UDTFluxCoreSubsystem::GetCurrentContestsId()
|
||||||
|
|||||||
@ -59,6 +59,33 @@ public:
|
|||||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
||||||
UDTFluxPursuitManager* PursuitManager = nullptr;
|
UDTFluxPursuitManager* PursuitManager = nullptr;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSplitSensor, FDTFluxSplitSensorInfo, SplitSensorInfo);
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
||||||
|
FOnSplitSensor OnSplitSensor;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnFinisher, FDTFluxSplitSensorInfo, SplitSensorInfo);
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
||||||
|
FOnFinisher OnFinisher;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWinner, FDTFluxSplitSensorInfo, SplitSensorInfo);
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
||||||
|
FOnWinner OnWinner;
|
||||||
|
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||||
|
bool GetStageRankingForBib(const int ContestId, const int StageId, const int Bib,
|
||||||
|
FDTFluxStageRanking& OutStageRankings);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||||
|
bool GetSplitRankingForBib(const int ContestId, const int StageId, const int SplitId, const int Bib,
|
||||||
|
FDTFluxSplitRanking& OutSplitRankings);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||||
|
bool GetContestRanking(const int ContestId, FDTFluxContestRanking& OutContestRanking);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||||
bool GetContestRankings(const int ContestId, FDTFluxContestRankings& OutContestRankings);
|
bool GetContestRankings(const int ContestId, FDTFluxContestRankings& OutContestRankings);
|
||||||
|
|
||||||
@ -88,7 +115,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||||
const FDTFluxParticipant GetParticipant(int InBib);
|
bool GetParticipant(int InBib, FDTFluxParticipant& OutParticipant);
|
||||||
|
|
||||||
//TODO : this must be a ProjectSetting
|
//TODO : this must be a ProjectSetting
|
||||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Core Subsystem")
|
||||||
|
|||||||
@ -9,7 +9,8 @@ FText UFTDFluxUtils::GetFormatedName(const int& Bib, const int MaxChar, const FS
|
|||||||
const FString OverFlowChar)
|
const FString OverFlowChar)
|
||||||
{
|
{
|
||||||
UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
UDTFluxCoreSubsystem* CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
||||||
const FDTFluxParticipant OutParticipant = CoreSubsystem->GetParticipant(Bib);
|
FDTFluxParticipant OutParticipant;
|
||||||
|
CoreSubsystem->GetParticipant(Bib, OutParticipant);
|
||||||
return OutParticipant.GetFormattedNameText(MaxChar, Separator, OverFlowChar);
|
return OutParticipant.GetFormattedNameText(MaxChar, Separator, OverFlowChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user