39 lines
725 B
C++
39 lines
725 B
C++
//
|
|
|
|
|
|
#include "UI/ItemStacks/ItemDataDraggingWidget.h"
|
|
|
|
#include "CommonTextBlock.h"
|
|
#include "Components/Image.h"
|
|
#include "Components/SizeBox.h"
|
|
|
|
void UItemDataDraggingWidget::NativePreConstruct()
|
|
{
|
|
Super::NativePreConstruct();
|
|
if (MainSizeBox)
|
|
{
|
|
MainSizeBox->SetHeightOverride(Height);
|
|
MainSizeBox->SetWidthOverride(Width);
|
|
}
|
|
SetAmount(ItemAmount);
|
|
SetIcon(IconTexture);
|
|
}
|
|
|
|
void UItemDataDraggingWidget::SetAmount(const int32 InAmount)
|
|
{
|
|
ItemAmount = InAmount;
|
|
if (AmountText)
|
|
{
|
|
AmountText->SetText(FText::AsNumber(ItemAmount));
|
|
}
|
|
}
|
|
|
|
void UItemDataDraggingWidget::SetIcon(UTexture2D* InIconTexture)
|
|
{
|
|
IconTexture = InIconTexture;
|
|
if (IconImage)
|
|
{
|
|
IconImage->SetBrushFromTexture(IconTexture);
|
|
}
|
|
}
|