Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
SubscriptionAlertPresenter.h
이 파일의 문서화 페이지로 가기
1#pragma once
2
4#include "Curves/CurveFloat.h"
5#include "Engine/TimerHandle.h"
6#include "SubscriptionAlertPresenter.generated.h"
7
9class UWorld;
10
11DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSubscriptionMessageChanged, const FText&, Message);
12
13DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSubscriptionAlertVisibilityChanged, bool, bVisible);
14
15
16UCLASS(BlueprintType, Blueprintable)
18{
19 GENERATED_BODY()
20
21public:
23
24public:
25 virtual void DeinitializePresenter() override;
26 virtual void OnViewBound(UUserWidgetBase* View) override;
27 virtual void OnViewUnbound(UUserWidgetBase* View) override;
28
29public:
30 UFUNCTION(BlueprintCallable, Category = "SubscriptionAlert")
31 void SetSubscriptionInfo(FName EnemyName, int32 PreviousFollowerCount, int32 NewFollowerCount);
32
33 UFUNCTION(BlueprintCallable, Category = "SubscriptionAlert")
34 void ResetSubscriptionInfo();
35
36public:
37 UFUNCTION(BlueprintPure, Category = "SubscriptionAlert")
38 FORCEINLINE bool IsAlertVisible() const
39 {
40 return bAlertVisible;
41 }
42
43 UFUNCTION(BlueprintPure, Category = "SubscriptionAlert")
44 FORCEINLINE FText GetSubscriptionMessage() const
45 {
46 return SubscriptionMessage;
47 }
48
49private:
50 void ReleaseRuntime();
51 void UpdateFollowerCount();
52 void UpdateSubscriptionMessage();
53 void SetAlertVisible(bool bVisible);
54
55protected:
56 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "SubscriptionAlert", meta = (ClampMin = "0.01", Units = "s"))
57 float SubscriptionAlertDisplayDuration = 3.0f;
58
59 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "SubscriptionAlert", meta = (ClampMin = "0.0", Units = "s"))
60 float FollowerCountDuration = 1.0f;
61
62 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "SubscriptionAlert")
63 FRuntimeFloatCurve FollowerCountCurve;
64
65public:
66 UPROPERTY(BlueprintAssignable, Category = "SubscriptionAlert|Events")
67 FOnSubscriptionMessageChanged OnSubscriptionMessageChanged;
68
69 UPROPERTY(BlueprintAssignable, Category = "SubscriptionAlert|Events")
70 FOnSubscriptionAlertVisibilityChanged OnAlertVisibilityChanged;
71
72private:
73 TWeakObjectPtr<UUserWidgetBase> ActiveView;
74 TWeakObjectPtr<UWorld> ActiveWorld;
75 TWeakObjectPtr<UStreamingSubsystem> BoundStreamingSubsystem;
76
77private:
78 FTimerHandle FollowerCountTimerHandle;
79 FTimerHandle DisplayDurationTimerHandle;
80
81private:
82 FText SubscriptionSubjectName;
83 FText SubscriptionMessage;
84
85 double FollowerCountStartTime = 0.0;
86
87 int32 DisplayedFollowerCount = 0;
88 int32 StartFollowerCount = 0;
89 int32 TargetFollowerCount = 0;
90
91 bool bHasFollowerCount = false;
92 bool bAlertVisible = false;
93};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSubscriptionMessageChanged, const FText &, Message)
Definition StreamingSubsystem.h:25
Definition SubscriptionAlertPresenter.h:18
Definition UserPresenterBase.h:19
Definition UserWidgetBase.h:35