Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
ToastRootHUDWidget.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "TimerManager.h"
9#include "UI/UserWidgetBase.h"
10#include "ToastRootHUDWidget.generated.h"
11
12class UStackBox;
13class UDataTable;
15
16USTRUCT()
18{
19 GENERATED_BODY()
20
21public:
22 UPROPERTY()
23 TObjectPtr<UToastWidgetBase> ToastWidget;
24
25public:
26 int32 GroupID = 0;
27 FTimerHandle DurationTimerHandle;
28};
29
30USTRUCT()
32{
33 GENERATED_BODY()
34
35public:
36 UPROPERTY()
38};
39
43UCLASS(BlueprintType, Blueprintable)
45{
46 GENERATED_BODY()
47
48public:
49 UFUNCTION(BlueprintCallable, Category = "UI|Toast")
50 bool ShowToastByID(const int32 ToastID, const bool bDiscardPendingToasts = false);
51
52 UFUNCTION(BlueprintCallable, Category = "UI|Toast")
53 bool ShowToastByRowName(const FName ToastRowName, const bool bDiscardPendingToasts = false);
54
55 UFUNCTION(BlueprintCallable, Category = "UI|Toast")
56 void ShowToast(const FDT_ToastMessageTable& InToastData, const bool bDiscardPendingToasts = false);
57
58public:
59 UFUNCTION(BlueprintCallable, Category = "UI|Toast")
60 FORCEINLINE void SetToastDataTable(UDataTable* InToastDataTable)
61 {
62 CachedToastDataTable = InToastDataTable;
63 }
64
65 UFUNCTION(BlueprintPure, Category = "UI|Toast")
66 FORCEINLINE UDataTable* GetToastDataTable() const
67 {
68 return CachedToastDataTable;
69 }
70
71protected:
72 virtual void NativeDestruct() override;
73
74 int32 FindActiveToastIndexByGroupID(const int32 GroupID) const;
75 int32 FindActiveToastIndex(const UToastWidgetBase* ToastWidget) const;
76
77 void RequestOldestToastExit();
78 void ProcessPendingToastQueue();
79 UDataTable* ResolveToastDataTable();
80 void RequestToastExit(UToastWidgetBase* ToastWidget);
81 void RemoveToastWidget(UToastWidgetBase* ToastWidget);
82 void EnqueueToast(const FDT_ToastMessageTable& InToastData);
83 bool TryShowNextToastInGroup(UToastWidgetBase* ToastWidget);
84 void ShowToastInternal(const FDT_ToastMessageTable& InToastData);
85 bool TryUpdateActiveToastByGroup(const FDT_ToastMessageTable& InToastData);
86 UToastWidgetBase* CreateToastWidget(const FDT_ToastMessageTable& InToastData);
87 void StartToastDurationTimer(UToastWidgetBase* ToastWidget, const float ToastDuration);
88 void AddToastWidget(UToastWidgetBase* ToastWidget, const FDT_ToastMessageTable& InToastData);
89 const FDT_ToastMessageTable* FindNextToastRowInGroup(const FDT_ToastMessageTable& CurrentToastData);
90
91protected:
92 FORCEINLINE bool CanAddToastWidget() const
93 {
94 const int32 EffectiveMaxStackCount = FMath::Max(1, MaxStackCount);
95 return ActiveToastWidgets.Num() + ExitingToastCount < EffectiveMaxStackCount;
96 }
97
98protected:
99 UFUNCTION(BlueprintImplementableEvent, Category = "UI|Toast")
100 void OnToastRequested(const FDT_ToastMessageTable& InToastData);
101
102protected:
103 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|Toast")
104 TSubclassOf<UToastWidgetBase> ToastWidgetClass;
105
106 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|Toast", meta = (ClampMin = "1"))
107 int32 MaxStackCount = 3;
108
109 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "UI|Toast")
110 TObjectPtr<UDataTable> CachedToastDataTable;
111
112 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "UI|Toast", meta = (BindWidget))
113 TObjectPtr<UStackBox> ToastMessageStack;
114
115 UPROPERTY()
116 TArray<FActiveToastWidgetEntry> ActiveToastWidgets;
117
118 UPROPERTY()
119 TArray<FPendingToastWidgetEntry> PendingToastWidgets;
120
121protected:
122 int32 ExitingToastCount = 0;
123};
Definition StageEventBehaviorInterface.h:22
Definition ToastRootHUDWidget.h:45
FORCEINLINE bool CanAddToastWidget() const
Definition ToastRootHUDWidget.h:92
Definition ToastWidgetBase.h:20
FDT_ToastMessageTable ToastData
Definition ToastWidgetBase.h:67
Definition UserWidgetBase.h:35
virtual void NativeDestruct() override
Definition UserWidgetBase.cpp:43
Definition ToastRootHUDWidget.h:18
Definition DT_ToastMessageTable.h:10
Definition ToastRootHUDWidget.h:32