Files
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

46 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Utility/WidgetSlotPair.h"
#include "Components/PanelSlot.h"
#include "WidgetBlueprintEditorUtils.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(WidgetSlotPair)
UWidgetSlotPair::UWidgetSlotPair()
{
}
void UWidgetSlotPair::SetWidgetName(FName InWidgetName)
{
WidgetName = InWidgetName;
}
void UWidgetSlotPair::SetWidget(UWidget* InWidget)
{
WidgetName = InWidget->GetFName();
TMap<FName, FString> ExportedSlotProperties;
FWidgetBlueprintEditorUtils::ExportPropertiesToText(InWidget->Slot, ExportedSlotProperties);
for ( const auto& Entry : ExportedSlotProperties )
{
SlotPropertyNames.Add(Entry.Key);
SlotPropertyValues.Add(Entry.Value);
}
}
FName UWidgetSlotPair::GetWidgetName() const
{
return WidgetName;
}
void UWidgetSlotPair::GetSlotProperties(TMap<FName, FString>& OutSlotProperties) const
{
checkSlow(SlotPropertyNames.Num() == SlotPropertyValues.Num());
for ( int32 PropertyIndex = 0; PropertyIndex < SlotPropertyNames.Num(); PropertyIndex++ )
{
OutSlotProperties.Add(SlotPropertyNames[PropertyIndex], SlotPropertyValues[PropertyIndex]);
}
}