Optimizing the code

This commit is contained in:
martinluckyrobots 2025-04-21 13:06:01 +08:00
parent df872258a6
commit a1bdd76447
17 changed files with 85 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "UI/Common/MenuTitleUserWidget.h"

View File

@ -0,0 +1,11 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "UI/Common/TextFieldUserWidget.h"
void UTextFieldUserWidget::NativeConstruct()
{
Super::NativeConstruct();
UpdateDisplay();
}

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "MenuTitleUserWidget.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnClickCloseButton);
/**
*
*/
UCLASS()
class LUCKYWORLDV2_API UMenuTitleUserWidget : public UUserWidget
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
FString MenuTitle;
public:
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnClickCloseButton OnClickCloseButton;
};

View File

@ -0,0 +1,42 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "TextFieldUserWidget.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEditText, FString, editstr);
/**
*
*/
UCLASS()
class LUCKYWORLDV2_API UTextFieldUserWidget : public UUserWidget
{
GENERATED_BODY()
protected:
virtual void NativeConstruct() override;
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
FString SettingFieldLabel;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
UTexture2D* SettingIcon;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
FString SettingString;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
FLinearColor SettingColor;
public:
UPROPERTY(BlueprintCallable, BlueprintAssignable)
FOnEditText OnEditText;
public:
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void UpdateDisplay();
};