Optimizing some UI

This commit is contained in:
martinluckyrobots
2025-04-15 22:06:41 +08:00
parent 4692cd734e
commit 78f94c5985
13 changed files with 123 additions and 23 deletions

View File

@ -0,0 +1,43 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "UISubsystem.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStartTracing);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnEndTracing);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStartCapture);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStopCapture);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnReset);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnOpenMenuStateChanged, bool, Open);
/**
*
*/
UCLASS()
class LUCKYWORLDV2_API UUISubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnStartTracing OnStartTracing;
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnEndTracing OnEndTracing;
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnStartCapture OnStartCapture;
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnStopCapture OnStopCapture;
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnReset OnReset;
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnOpenMenuStateChanged OnOpenMenuStateChanged;
};

View File

@ -7,8 +7,6 @@
#include "SharedDef.h"
#include "GameUserWidget.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnReset);
class UCaptureSettingsUserWidget;
class USelectGoalUserWidget;
class UAllRandomUserWidget;
@ -42,10 +40,6 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString DownCountStr;
public:
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event")
FOnReset OnReset;
public:
UFUNCTION(BlueprintCallable)
void DoWaitSecond();
@ -75,6 +69,10 @@ public:
void ToggleShowPath();
void UpdateDownCount();
void OnStartTracing();
void OnEndTracing();
public:
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void DoLogItemAdd(const FString& Topic, const FString& MsgText, ELogItemType LogItemType);
@ -87,4 +85,7 @@ public:
UFUNCTION(BlueprintPure, BlueprintImplementableEvent)
UAllRandomUserWidget* GetAllRandomUserWidget();
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void BPPlayShowTipAnimation();
};

View File

@ -7,10 +7,6 @@
#include "SharedDef.h"
#include "CaptureSettingsUserWidget.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnOpenMenuStateChanged, bool, Open);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStartCapture);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStopCapture);
class UTaskListViewUserWidget;
/**
*
@ -27,15 +23,6 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bIsOpen;
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event")
FOnOpenMenuStateChanged OnOpenMenuStateChanged;
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event")
FOnStartCapture OnStartCapture;
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event")
FOnStopCapture OnStopCapture;
public:
UFUNCTION(BlueprintCallable)
void ToggleMenu();

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "PathfindingSelectorUserWidget.generated.h"
/**
*
*/
UCLASS()
class LUCKYWORLDV2_API UPathfindingSelectorUserWidget : public UUserWidget
{
GENERATED_BODY()
};