// Project Lab - NHTV Igad

#include "UnrealProject.h"
#include "EffectSlot.h"
#include "AbilityInfo.h"

void UEffectSlot::NativeConstruct()
{
	m_name = Cast<UTextBlock>(WidgetTree->FindWidget("NameField"));
	m_image = Cast<UImage>(WidgetTree->FindWidget("Icon"));

	Super::NativeConstruct();
}
void UEffectSlot::Init(class UAbilityInfo* ability)
{
	this->ability = ability;

	if(!ability)
		return;

	if(m_name)
	{
		m_name->SetText(FText::FromString(ability->name));
	}
	if(m_image)
	{
		m_image->SetBrushFromTexture(ability->icon);
	}

	OnInit(ability);
}
