// Project Lab - NHTV Igad #include "UnrealProject.h" #include "SpellInfoDisplay.h" #include "BaseSkillObject.h" #include "SpellInfo.h" void USpellInfoDisplay::NativeConstruct() { m_container = Cast(WidgetTree->FindWidget("Container")); } void USpellInfoDisplay::OnLevelUp(class ANetworkPlayer* _player, TArray updatedSkills) { if (!m_container) return; player = _player; for (int32 i = 0; i < updatedSkills.Num(); i++) { USpellInfo* info = CreateWidget(GetWorld(), spellInfoClass); UPanelSlot* slot = m_container->AddChild(info); if (Cast(slot)) { Cast(slot)->SetHorizontalAlignment(HAlign_Right); } else if(Cast(slot)) { UVerticalBoxSlot* vslot = Cast(slot); vslot->SetHorizontalAlignment(HAlign_Left); Cast(slot)->SetVerticalAlignment(VAlign_Fill); } info->Set(updatedSkills[i].selectedEffect, updatedSkills[i].level, updatedSkills[i].power, this); } }