GASATHON/Project/Source/Gasa/UI/GasaHUD.cpp

36 lines
930 B
C++
Raw Normal View History

#include "GasaHUD.h"
2024-04-21 15:56:57 -07:00
#include "GasaHUD_Inlines.h"
#include "GasaDevOptions.h"
2024-04-21 15:56:57 -07:00
#include "HUDHostWidget.h"
#include "Blueprint/UserWidget.h"
using namespace Gasa;
2024-04-21 21:30:29 -07:00
void AGasaHUD::InitHostWidget(FWidgetControllerData const* WidgetControllerData)
2024-04-21 15:56:57 -07:00
{
HostWidget = CreateWidget<UHUDHostWidget>( GetWorld()
2024-04-21 15:56:57 -07:00
, GetDevOptions()->Template_HUD_HostUI.LoadSynchronous() );
HostWidgetController = NewObject<UHostWidgetController>(this, GetDevOptions()->Template_HostWidgetController.Get());
2024-04-21 21:30:29 -07:00
HostWidgetController->Data = (* WidgetControllerData);
2024-04-21 15:56:57 -07:00
HostWidget->SetWidgetController(HostWidgetController);
2024-04-21 22:54:33 -07:00
HostWidgetController->BindCallbacksToDependencies();
2024-04-21 21:30:29 -07:00
HostWidgetController->BroadcastInitialValues();
2024-04-21 15:56:57 -07:00
HostWidget->AddToViewport();
}
#pragma region HUD
void AGasaHUD::ShowHUD()
{
Super::ShowHUD();
}
#pragma endregion HUD
#pragma region Actor
void AGasaHUD::BeginPlay()
{
Super::BeginPlay();
}
#pragma endregion Actor