2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#include "LyraWidgetFactory_Class.h"
|
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Blueprint/UserWidget.h"
|
|
|
|
#include "UObject/Class.h"
|
|
|
|
#include "UObject/Object.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
TSubclassOf<UUserWidget> ULyraWidgetFactory_Class::FindWidgetClassForData_Implementation(const UObject* Data) const
|
|
|
|
{
|
|
|
|
// Starting with the current class, work backwards to see if there are any construction rules for this class.
|
|
|
|
for (UClass* Class = Data->GetClass(); Class; Class = Class->GetSuperClass())
|
|
|
|
{
|
|
|
|
TSoftClassPtr<UObject> ClassPtr(Class);
|
|
|
|
if (const TSubclassOf<UUserWidget> EntryWidgetClassPtr = EntryWidgetForClass.FindRef(ClassPtr))
|
|
|
|
{
|
|
|
|
return EntryWidgetClassPtr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TSubclassOf<UUserWidget>();
|
|
|
|
}
|