Download LyraStarterGame/Source/LyraGame/UI/Common/LyraListView.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Common/LyraListView.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/Common/LyraListView.cpp
-
curl -L -o LyraListView.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Common/LyraListView.cpp
1.37 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| ULyraListView::ULyraListView(const FObjectInitializer& ObjectInitializer) | |
| : Super(ObjectInitializer) | |
| { | |
| } | |
| void ULyraListView::ValidateCompiledDefaults(IWidgetCompilerLog& InCompileLog) const | |
| { | |
| Super::ValidateCompiledDefaults(InCompileLog); | |
| if (FactoryRules.Num() == 0) | |
| { | |
| InCompileLog.Error(FText::Format(FText::FromString("{0} has no Factory Rules defined, can't create widgets without them."), FText::FromString(GetName()))); | |
| } | |
| } | |
| UUserWidget& ULyraListView::OnGenerateEntryWidgetInternal(UObject* Item, TSubclassOf<UUserWidget> DesiredEntryClass, const TSharedRef<STableViewBase>& OwnerTable) | |
| { | |
| TSubclassOf<UUserWidget> WidgetClass = DesiredEntryClass; | |
| for (const ULyraWidgetFactory* Rule : FactoryRules) | |
| { | |
| if (Rule) | |
| { | |
| if (const TSubclassOf<UUserWidget> EntryClass = Rule->FindWidgetClassForData(Item)) | |
| { | |
| WidgetClass = EntryClass; | |
| break; | |
| } | |
| } | |
| } | |
| UUserWidget& EntryWidget = GenerateTypedEntry<UUserWidget>(WidgetClass, OwnerTable); | |
| return EntryWidget; | |
| } | |