Space Plunder
Loading...
Searching...
No Matches
FRadialMenuData Struct Reference

#include <RadialWheelData.h>

Inheritance diagram for FRadialMenuData:

Public Member Functions

bool IsEmpty () const
 
 FRadialMenuData ()
 
 FRadialMenuData (const FName &GameplayTagCategory, const FString &DataTableLocation)
 

Public Attributes

TArray< FRadialSegmentDataSelections
 
bool bShowSegmentDescription = true
 
bool bCenterDescription = true
 
bool bLeftJoystick = false
 
bool bUseCustomColors = false
 
FLinearColor OuterRingColor = FLinearColor(0.0f,0.25641f, 1.0f)
 
FLinearColor InnerRingColor = FLinearColor(0.369792f,0.369792f, 0.369792f)
 
FLinearColor RingMainColor = FLinearColor(1.0f,1.0f, 1.0f)
 
FLinearColor UnhighlightColor = FLinearColor(0.291667f, 0.291667f, 0.291667f)
 
bool bUseCustomSize = false
 
FVector2D MenuSize = FVector2D(512.0f, 512.0f)
 

Constructor & Destructor Documentation

◆ FRadialMenuData() [1/2]

FRadialMenuData::FRadialMenuData ( )
inline
137 {
138
139 }

◆ FRadialMenuData() [2/2]

FRadialMenuData::FRadialMenuData ( const FName & GameplayTagCategory,
const FString & DataTableLocation )
inlineexplicit
141 {
142 const UDataTable* RadialMenuDataTable = LoadObject<UDataTable>(nullptr, *DataTableLocation);
143 if (RadialMenuDataTable == nullptr)
144 {
145 UE_LOG(LogTemp, Error, TEXT("Failed to load Radial Menu DataTable"));
146 return;
147 }
148
149 TArray<FGameplayTag> GameplayTags = UBaseHelpersBPLib::GetAllTagsOfCategory(GameplayTagCategory);
150 // Iterate through the GameplayTags and find matching entries in the DataTable
151 for (const FGameplayTag& Tag : GameplayTags)
152 {
153 // Get just the last part of the GameplayTag (e.g., "Default" from "Character.Mode.Default")
154 FString LastTagPart;
155 Tag.GetTagName().ToString().Split(TEXT("."), nullptr, &LastTagPart, ESearchCase::IgnoreCase, ESearchDir::FromEnd);
156 // FString TagName = Tag.ToString(); // Convert the GameplayTag to a string to search in the DataTable
157
158 // Try to find a matching row in the DataTable
159 FRadialSegmentData* Row = RadialMenuDataTable->FindRow<FRadialSegmentData>(FName(LastTagPart), TEXT("RadialMenu"));
160 if (Row != nullptr)
161 {
162 // Add the row to the Selections if it's not already added
163 if(!Selections.ContainsByPredicate([&](const FRadialSegmentData& ExistingRow)
164 {
165 return ExistingRow.Name == Row->Name; // Check if we already added a segment with the same name
166 }))
167 {
168 Selections.Add(*Row); // Add unique entry
169 }
170 }
171 }
172 UE_LOG(LogTemp, Warning, TEXT("Radial Menu created with %d options"), Selections.Num());
173 // for(auto Tag : GameplayTags)
174 // {
175 // UE_LOG(LogTemp, Warning, TEXT("Gameplay Tag: %s"), *Tag.ToString());
176 // }
177 // const TCHAR* LocationText = *DataTableLocation;
178 // const UDataTable* RadialMenuDataTable = LoadObject<UDataTable>(nullptr, LocationText);
179 // if(RadialMenuDataTable != nullptr)
180 // {
181 // TArray<FRadialSegmentData*> AllRows;
182 // RadialMenuDataTable->GetAllRows<FRadialSegmentData>(TEXT("RadialMenu"), AllRows);
183 // for (const FRadialSegmentData* Row : AllRows)
184 // {
185 // // Add each row as a segment in the radial menu
186 // Selections.Add(*Row);
187 // }
188 // UE_LOG(LogTemp, Warning, TEXT("Gameplay Tag: menu CREATED"));
189 // }
190 }
static TArray< FGameplayTag > GetAllTagsOfCategory(const FName &Category)
Definition BaseHelpersBPLib.cpp:500
TArray< FRadialSegmentData > Selections
Definition RadialWheelData.h:106
Definition RadialWheelData.h:72

Member Function Documentation

◆ IsEmpty()

bool FRadialMenuData::IsEmpty ( ) const
inline
132 {
133 return Selections.IsEmpty();
134 }

Member Data Documentation

◆ bCenterDescription

bool FRadialMenuData::bCenterDescription = true

◆ bLeftJoystick

bool FRadialMenuData::bLeftJoystick = false

◆ bShowSegmentDescription

bool FRadialMenuData::bShowSegmentDescription = true

◆ bUseCustomColors

bool FRadialMenuData::bUseCustomColors = false

◆ bUseCustomSize

bool FRadialMenuData::bUseCustomSize = false

◆ InnerRingColor

FLinearColor FRadialMenuData::InnerRingColor = FLinearColor(0.369792f,0.369792f, 0.369792f)

◆ MenuSize

FVector2D FRadialMenuData::MenuSize = FVector2D(512.0f, 512.0f)

◆ OuterRingColor

FLinearColor FRadialMenuData::OuterRingColor = FLinearColor(0.0f,0.25641f, 1.0f)

◆ RingMainColor

FLinearColor FRadialMenuData::RingMainColor = FLinearColor(1.0f,1.0f, 1.0f)

◆ Selections

TArray<FRadialSegmentData> FRadialMenuData::Selections

◆ UnhighlightColor

FLinearColor FRadialMenuData::UnhighlightColor = FLinearColor(0.291667f, 0.291667f, 0.291667f)

The documentation for this struct was generated from the following file: