Optimizing WB_CaptureSettings
This commit is contained in:
parent
8d20bf761d
commit
e670c690ce
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -7,7 +7,7 @@
|
||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
||||
#include "Subsystems/SubsystemBlueprintLibrary.h"
|
||||
#include "VaRestSubsystem.h"
|
||||
#include <Kismet/GameplayStatics.h>
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
void UMainScreenUserWidget::NativeConstruct()
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
@ -47,4 +47,7 @@ public:
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void DoRefreshListView();
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void DoAutoConfirm();
|
||||
};
|
||||
|
@ -7,6 +7,8 @@
|
||||
#include "SharedDef.h"
|
||||
#include "CaptureSettingsUserWidget.generated.h"
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnOpenMenuStateChanged, bool, Open);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -14,12 +16,30 @@ UCLASS()
|
||||
class LUCKYROBOTS_API UCaptureSettingsUserWidget : public UUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
protected:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bIsOpen;
|
||||
|
||||
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event")
|
||||
FOnOpenMenuStateChanged OnOpenMenuStateChanged;
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void ToggleMenu();
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void BPRefreshTaskList();
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void BPOnRandomMeshesUpdated();
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void BPLoadSettings();
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void ToggleMenuDisplay();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user