You've already forked LuckyWorld
Optimizing some UI
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include "UI/Settings/SelectGoalUserWidget.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Gameplay/NaviSplineCreator.h"
|
||||
#include "Subsystem/UISubsystem.h"
|
||||
|
||||
void UGameUserWidget::NativeConstruct()
|
||||
{
|
||||
@ -17,6 +18,13 @@ void UGameUserWidget::NativeConstruct()
|
||||
{
|
||||
GameInstance->GameUserWidget = this;
|
||||
}
|
||||
|
||||
auto UISubsystem = GetGameInstance()->GetSubsystem<UUISubsystem>();
|
||||
if (UISubsystem)
|
||||
{
|
||||
UISubsystem->OnStartTracing.AddDynamic(this, &UGameUserWidget::OnStartTracing);
|
||||
UISubsystem->OnEndTracing.AddDynamic(this, &UGameUserWidget::OnEndTracing);
|
||||
}
|
||||
}
|
||||
|
||||
void UGameUserWidget::DoWaitSecond()
|
||||
@ -54,6 +62,23 @@ void UGameUserWidget::UpdateDownCount()
|
||||
}
|
||||
}
|
||||
|
||||
void UGameUserWidget::OnStartTracing()
|
||||
{
|
||||
bIsTracing = true;
|
||||
}
|
||||
|
||||
void UGameUserWidget::OnEndTracing()
|
||||
{
|
||||
bIsTracing = false;
|
||||
|
||||
BPPlayShowTipAnimation();
|
||||
|
||||
if (GetCaptureSettingsUserWidget())
|
||||
{
|
||||
GetCaptureSettingsUserWidget()->BPSaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void UGameUserWidget::ToggleHide()
|
||||
{
|
||||
ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||
@ -103,7 +128,11 @@ void UGameUserWidget::DoReset()
|
||||
}
|
||||
}
|
||||
|
||||
OnReset.Broadcast();
|
||||
auto UISubsystem = GetGameInstance()->GetSubsystem<UUISubsystem>();
|
||||
if (UISubsystem)
|
||||
{
|
||||
UISubsystem->OnReset.Broadcast();
|
||||
}
|
||||
}
|
||||
|
||||
void UGameUserWidget::DoExit()
|
||||
|
Reference in New Issue
Block a user