You've already forked LuckyWorld
Optimizing WB_CaptureSettings
This commit is contained in:
@ -2,4 +2,39 @@
|
||||
|
||||
|
||||
#include "UI/Settings/CaptureSettingsUserWidget.h"
|
||||
#include "Core/LuckyRobotsGameInstance.h"
|
||||
#include "UI/GameUserWidget.h"
|
||||
|
||||
void UCaptureSettingsUserWidget::NativeConstruct()
|
||||
{
|
||||
Super::NativeConstruct();
|
||||
|
||||
BPRefreshTaskList();
|
||||
ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||
if (GameInstance)
|
||||
{
|
||||
GameInstance->OnRandomMeshesUpdated.AddDynamic(this, &UCaptureSettingsUserWidget::BPOnRandomMeshesUpdated);
|
||||
}
|
||||
}
|
||||
|
||||
void UCaptureSettingsUserWidget::ToggleMenu()
|
||||
{
|
||||
bIsOpen = !bIsOpen;
|
||||
|
||||
if (bIsOpen)
|
||||
{
|
||||
BPLoadSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||
if (GameInstance && GameInstance->GameUserWidget)
|
||||
{
|
||||
GameInstance->GameUserWidget->DoAutoConfirm();
|
||||
}
|
||||
}
|
||||
|
||||
OnOpenMenuStateChanged.Broadcast(bIsOpen);
|
||||
|
||||
ToggleMenuDisplay();
|
||||
}
|
Reference in New Issue
Block a user