Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
USubscriptionAlertPresenter 클래스 참조

#include <SubscriptionAlertPresenter.h>

USubscriptionAlertPresenter에 대한 상속 다이어그램 :
Inheritance graph
USubscriptionAlertPresenter에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

 USubscriptionAlertPresenter ()
 
virtual void DeinitializePresenter () override
 
virtual void OnViewBound (UUserWidgetBase *View) override
 
virtual void OnViewUnbound (UUserWidgetBase *View) override
 
void SetSubscriptionInfo (FName EnemyName, int32 PreviousFollowerCount, int32 NewFollowerCount)
 
void ResetSubscriptionInfo ()
 
FORCEINLINE bool IsAlertVisible () const
 
FORCEINLINE FText GetSubscriptionMessage () const
 
- UUserPresenterBase(으)로부터 상속된 Public 멤버 함수
virtual void InitializePresenter (UUIManagementSubsystem *Subsystem) override
 
virtual UWorld * GetWorld () const override
 
FORCEINLINE UUIManagementSubsystem * GetUISubsystem () const
 
void SetInputKeys (APlayerController *PlayerController, const TArray< FKey > &Keys, int32 Priority=100)
 
void DisableInput ()
 

Public 속성

FOnSubscriptionMessageChanged OnSubscriptionMessageChanged
 
FOnSubscriptionAlertVisibilityChanged OnAlertVisibilityChanged
 

Protected 속성

float SubscriptionAlertDisplayDuration = 3.0f
 
float FollowerCountDuration = 1.0f
 
FRuntimeFloatCurve FollowerCountCurve
 

Private 멤버 함수

void ReleaseRuntime ()
 
void UpdateFollowerCount ()
 
void UpdateSubscriptionMessage ()
 
void SetAlertVisible (bool bVisible)
 

Private 속성

TWeakObjectPtr< UUserWidgetBase > ActiveView
 
TWeakObjectPtr< UWorld > ActiveWorld
 
TWeakObjectPtr< UStreamingSubsystem > BoundStreamingSubsystem
 
FTimerHandle FollowerCountTimerHandle
 
FTimerHandle DisplayDurationTimerHandle
 
FText SubscriptionSubjectName
 
FText SubscriptionMessage
 
double FollowerCountStartTime = 0.0
 
int32 DisplayedFollowerCount = 0
 
int32 StartFollowerCount = 0
 
int32 TargetFollowerCount = 0
 
bool bHasFollowerCount = false
 
bool bAlertVisible = false
 

추가로 상속된 멤버들

- UUserPresenterBase(으)로부터 상속된 Protected 멤버 함수
void ReceiveInitializePresenter (UUIManagementSubsystem *Subsystem)
 
void ReceiveDeinitializePresenter ()
 
void ReceiveViewBound (UUserWidgetBase *View)
 
void ReceiveViewUnbound (UUserWidgetBase *View)
 

생성자 & 소멸자 문서화

◆ USubscriptionAlertPresenter()

USubscriptionAlertPresenter::USubscriptionAlertPresenter ( )
10{
11 FollowerCountCurve.EditorCurveData.AddKey(0.0f, 0.0f);
12 FollowerCountCurve.EditorCurveData.AddKey(1.0f, 1.0f);
13}
FRuntimeFloatCurve FollowerCountCurve
Definition SubscriptionAlertPresenter.h:63

다음을 참조함 : FollowerCountCurve.

멤버 함수 문서화

◆ DeinitializePresenter()

void USubscriptionAlertPresenter::DeinitializePresenter ( )
overridevirtual

UUserPresenterBase(으)로부터 재구현되었습니다.

52{
56 Super::DeinitializePresenter();
57}
void ReleaseRuntime()
Definition SubscriptionAlertPresenter.cpp:60
FOnSubscriptionMessageChanged OnSubscriptionMessageChanged
Definition SubscriptionAlertPresenter.h:67
FOnSubscriptionAlertVisibilityChanged OnAlertVisibilityChanged
Definition SubscriptionAlertPresenter.h:70

다음을 참조함 : OnAlertVisibilityChanged, OnSubscriptionMessageChanged, ReleaseRuntime().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ GetSubscriptionMessage()

FORCEINLINE FText USubscriptionAlertPresenter::GetSubscriptionMessage ( ) const
inline
45 {
47 }
FText SubscriptionMessage
Definition SubscriptionAlertPresenter.h:83

다음에 의해서 참조됨 : USubscriptionAlertHUDWidget::BindPresenter_Implementation().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ IsAlertVisible()

FORCEINLINE bool USubscriptionAlertPresenter::IsAlertVisible ( ) const
inline
39 {
40 return bAlertVisible;
41 }
bool bAlertVisible
Definition SubscriptionAlertPresenter.h:92

다음에 의해서 참조됨 : USubscriptionAlertHUDWidget::BindPresenter_Implementation().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnViewBound()

void USubscriptionAlertPresenter::OnViewBound ( UUserWidgetBase *  View)
overridevirtual

UUserPresenterBase(으)로부터 재구현되었습니다.

17{
18 if (View == nullptr)
19 {
20 return;
21 }
22
24 ActiveView = View;
25 ActiveWorld = View->GetWorld();
26 UWorld* World = ActiveWorld.Get();
27
28 if (UStreamingSubsystem* Streaming = World ? World->GetSubsystem<UStreamingSubsystem>() : nullptr)
29 {
30 BoundStreamingSubsystem = Streaming;
31 Streaming->OnSubscriberReward.AddUObject(this, &ThisClass::SetSubscriptionInfo);
32 }
33
34 Super::OnViewBound(View);
35}
Definition StreamingSubsystem.h:25
TWeakObjectPtr< UWorld > ActiveWorld
Definition SubscriptionAlertPresenter.h:74
TWeakObjectPtr< UUserWidgetBase > ActiveView
Definition SubscriptionAlertPresenter.h:73
TWeakObjectPtr< UStreamingSubsystem > BoundStreamingSubsystem
Definition SubscriptionAlertPresenter.h:75

다음을 참조함 : ActiveView, ActiveWorld, BoundStreamingSubsystem, ReleaseRuntime().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ OnViewUnbound()

void USubscriptionAlertPresenter::OnViewUnbound ( UUserWidgetBase *  View)
overridevirtual

UUserPresenterBase(으)로부터 재구현되었습니다.

39{
40 Super::OnViewUnbound(View);
41
42 if (ActiveView.Get() != View)
43 {
44 return;
45 }
46
48}

다음을 참조함 : ActiveView, ReleaseRuntime().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ ReleaseRuntime()

void USubscriptionAlertPresenter::ReleaseRuntime ( )
private
61{
62 if (UStreamingSubsystem* Streaming = BoundStreamingSubsystem.Get())
63 {
64 Streaming->OnSubscriberReward.RemoveAll(this);
65 }
66
69 ActiveView.Reset();
70 ActiveWorld.Reset();
71}
void ResetSubscriptionInfo()
Definition SubscriptionAlertPresenter.cpp:74

다음을 참조함 : ActiveView, ActiveWorld, BoundStreamingSubsystem, ResetSubscriptionInfo().

다음에 의해서 참조됨 : DeinitializePresenter(), OnViewBound(), OnViewUnbound().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ ResetSubscriptionInfo()

void USubscriptionAlertPresenter::ResetSubscriptionInfo ( )
75{
76 if (UWorld* World = ActiveWorld.Get())
77 {
78 World->GetTimerManager().ClearTimer(FollowerCountTimerHandle);
79 World->GetTimerManager().ClearTimer(DisplayDurationTimerHandle);
80 }
81 SubscriptionSubjectName = FText::GetEmpty();
82 SubscriptionMessage = FText::GetEmpty();
86 bHasFollowerCount = false;
87 SetAlertVisible(false);
89}
void SetAlertVisible(bool bVisible)
Definition SubscriptionAlertPresenter.cpp:92
int32 DisplayedFollowerCount
Definition SubscriptionAlertPresenter.h:87
int32 TargetFollowerCount
Definition SubscriptionAlertPresenter.h:89
FTimerHandle DisplayDurationTimerHandle
Definition SubscriptionAlertPresenter.h:79
FText SubscriptionSubjectName
Definition SubscriptionAlertPresenter.h:82
FTimerHandle FollowerCountTimerHandle
Definition SubscriptionAlertPresenter.h:78
bool bHasFollowerCount
Definition SubscriptionAlertPresenter.h:91
int32 StartFollowerCount
Definition SubscriptionAlertPresenter.h:88

다음을 참조함 : ActiveWorld, bHasFollowerCount, DisplayDurationTimerHandle, DisplayedFollowerCount, FollowerCountTimerHandle, OnSubscriptionMessageChanged, SetAlertVisible(), StartFollowerCount, SubscriptionMessage, SubscriptionSubjectName, TargetFollowerCount.

다음에 의해서 참조됨 : ReleaseRuntime().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SetAlertVisible()

void USubscriptionAlertPresenter::SetAlertVisible ( bool  bVisible)
private
93{
94 if (bAlertVisible == bVisible)
95 {
96 return;
97 }
98 bAlertVisible = bVisible;
100}

다음을 참조함 : bAlertVisible, OnAlertVisibilityChanged.

다음에 의해서 참조됨 : ResetSubscriptionInfo(), SetSubscriptionInfo().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SetSubscriptionInfo()

void USubscriptionAlertPresenter::SetSubscriptionInfo ( FName  EnemyName,
int32  PreviousFollowerCount,
int32  NewFollowerCount 
)
104{
105 UWorld* World = ActiveWorld.Get();
106
107 if (World == nullptr)
108 {
109 return;
110 }
111
112 World->GetTimerManager().ClearTimer(FollowerCountTimerHandle);
113
114 SubscriptionSubjectName = FText::FromName(EnemyName);
115
118 TargetFollowerCount = NewFollowerCount;
119 FollowerCountStartTime = World->GetTimeSeconds();
120 bHasFollowerCount = true;
121
122 if (FollowerCountDuration < KINDA_SMALL_NUMBER || StartFollowerCount >= TargetFollowerCount)
123 {
126 }
127 else
128 {
130 World->GetTimerManager().SetTimer(FollowerCountTimerHandle, this, &ThisClass::UpdateFollowerCount, 1.0f / 60.0f, true);
131 }
132
133 SetAlertVisible(true);
134
135 float DisplayDuration = SubscriptionAlertDisplayDuration;
136 if (FMath::IsFinite(DisplayDuration) == false || DisplayDuration < KINDA_SMALL_NUMBER)
137 {
138 DisplayDuration = 3.0f;
139 }
140
141 // 같은 핸들로 재설정하여 연속 알림은 마지막 알림부터 표시 시간을 센다.
142 World->GetTimerManager().SetTimer(DisplayDurationTimerHandle, this, &ThisClass::ResetSubscriptionInfo, DisplayDuration, false);
143}
double FollowerCountStartTime
Definition SubscriptionAlertPresenter.h:85
float SubscriptionAlertDisplayDuration
Definition SubscriptionAlertPresenter.h:57
void UpdateSubscriptionMessage()
Definition SubscriptionAlertPresenter.cpp:193

다음을 참조함 : ActiveWorld, bHasFollowerCount, DisplayDurationTimerHandle, DisplayedFollowerCount, FollowerCountStartTime, FollowerCountTimerHandle, SetAlertVisible(), StartFollowerCount, SubscriptionAlertDisplayDuration, SubscriptionSubjectName, TargetFollowerCount, UpdateSubscriptionMessage().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateFollowerCount()

void USubscriptionAlertPresenter::UpdateFollowerCount ( )
private
147{
148 UWorld* World = ActiveWorld.Get();
149
150 if (World == nullptr)
151 {
152 return;
153 }
154
155 double Alpha;
156
157 if (FollowerCountDuration < KINDA_SMALL_NUMBER)
158 {
159 Alpha = 1.0;
160 }
161 else
162 {
163 Alpha = FMath::Clamp((World->GetTimeSeconds() - FollowerCountStartTime) / FollowerCountDuration, 0.0, 1.0);
164 }
165
166 if (Alpha > (1.0 - KINDA_SMALL_NUMBER))
167 {
169 }
170 else
171 {
172 double CountAlpha = Alpha;
173 const float CurveValue = FollowerCountCurve.GetRichCurveConst()->Eval(static_cast<float>(Alpha), static_cast<float>(Alpha));
174 if (FMath::IsFinite(CurveValue))
175 {
176 CountAlpha = FMath::Clamp(CurveValue, 0.0f, 1.0f);
177 }
178
179 const int32 NewDisplayedCount = FMath::FloorToInt(FMath::Lerp(static_cast<double>(StartFollowerCount), static_cast<double>(TargetFollowerCount), CountAlpha));
180 // 커브가 내려가는 구간에서도 이미 표시한 구독자 수는 감소시키지 않는다.
181 DisplayedFollowerCount = FMath::Max(DisplayedFollowerCount, NewDisplayedCount);
182 }
183
185
186 if (Alpha >= 1.0)
187 {
188 World->GetTimerManager().ClearTimer(FollowerCountTimerHandle);
189 }
190}
float FollowerCountDuration
Definition SubscriptionAlertPresenter.h:60

다음을 참조함 : ActiveWorld, DisplayedFollowerCount, FollowerCountCurve, FollowerCountDuration, FollowerCountStartTime, FollowerCountTimerHandle, StartFollowerCount, TargetFollowerCount, UpdateSubscriptionMessage().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateSubscriptionMessage()

void USubscriptionAlertPresenter::UpdateSubscriptionMessage ( )
private
194{
195 const int32 RemainingCount = FMath::Max(TargetFollowerCount - DisplayedFollowerCount, 0);
196 FText CountText;
197
198 if (RemainingCount > 0)
199 {
200 CountText = FText::Format
201 (
202 NSLOCTEXT("SubscriptionAlert", "StyledIncreasingCount", "<Count>{0}</> + {1}"),
203 FText::AsNumber(DisplayedFollowerCount),
204 FText::AsNumber(RemainingCount)
205 );
206 }
207 else
208 {
209 CountText = FText::Format
210 (
211 NSLOCTEXT("SubscriptionAlert", "StyledSubscriberCount", "<Count>{0}</>"),
212 FText::AsNumber(DisplayedFollowerCount)
213 );
214 }
215
216 FText FormatText = NSLOCTEXT
217 (
218 "SubscriptionAlert",
219 "InlineSubscriberCount",
220 "<Donor>{0}</>을 싫어하는 성좌님 {1}명이 구독하셨습니다."
221 );
222
223 FText BaseText = FText::Format
224 (
225 FormatText,
227 CountText
228 );
229
230 SubscriptionMessage = BaseText;
232}

다음을 참조함 : DisplayedFollowerCount, OnSubscriptionMessageChanged, SubscriptionMessage, SubscriptionSubjectName, TargetFollowerCount.

다음에 의해서 참조됨 : SetSubscriptionInfo(), UpdateFollowerCount().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ ActiveView

TWeakObjectPtr<UUserWidgetBase> USubscriptionAlertPresenter::ActiveView
private

다음에 의해서 참조됨 : OnViewBound(), OnViewUnbound(), ReleaseRuntime().

◆ ActiveWorld

TWeakObjectPtr<UWorld> USubscriptionAlertPresenter::ActiveWorld
private

◆ bAlertVisible

bool USubscriptionAlertPresenter::bAlertVisible = false
private

다음에 의해서 참조됨 : SetAlertVisible().

◆ bHasFollowerCount

bool USubscriptionAlertPresenter::bHasFollowerCount = false
private

다음에 의해서 참조됨 : ResetSubscriptionInfo(), SetSubscriptionInfo().

◆ BoundStreamingSubsystem

TWeakObjectPtr<UStreamingSubsystem> USubscriptionAlertPresenter::BoundStreamingSubsystem
private

다음에 의해서 참조됨 : OnViewBound(), ReleaseRuntime().

◆ DisplayDurationTimerHandle

FTimerHandle USubscriptionAlertPresenter::DisplayDurationTimerHandle
private

다음에 의해서 참조됨 : ResetSubscriptionInfo(), SetSubscriptionInfo().

◆ DisplayedFollowerCount

int32 USubscriptionAlertPresenter::DisplayedFollowerCount = 0
private

◆ FollowerCountCurve

FRuntimeFloatCurve USubscriptionAlertPresenter::FollowerCountCurve
protected

다음에 의해서 참조됨 : UpdateFollowerCount(), USubscriptionAlertPresenter().

◆ FollowerCountDuration

float USubscriptionAlertPresenter::FollowerCountDuration = 1.0f
protected

다음에 의해서 참조됨 : UpdateFollowerCount().

◆ FollowerCountStartTime

double USubscriptionAlertPresenter::FollowerCountStartTime = 0.0
private

다음에 의해서 참조됨 : SetSubscriptionInfo(), UpdateFollowerCount().

◆ FollowerCountTimerHandle

FTimerHandle USubscriptionAlertPresenter::FollowerCountTimerHandle
private

◆ OnAlertVisibilityChanged

FOnSubscriptionAlertVisibilityChanged USubscriptionAlertPresenter::OnAlertVisibilityChanged

◆ OnSubscriptionMessageChanged

FOnSubscriptionMessageChanged USubscriptionAlertPresenter::OnSubscriptionMessageChanged

◆ StartFollowerCount

int32 USubscriptionAlertPresenter::StartFollowerCount = 0
private

◆ SubscriptionAlertDisplayDuration

float USubscriptionAlertPresenter::SubscriptionAlertDisplayDuration = 3.0f
protected

다음에 의해서 참조됨 : SetSubscriptionInfo().

◆ SubscriptionMessage

FText USubscriptionAlertPresenter::SubscriptionMessage
private

다음에 의해서 참조됨 : ResetSubscriptionInfo(), UpdateSubscriptionMessage().

◆ SubscriptionSubjectName

FText USubscriptionAlertPresenter::SubscriptionSubjectName
private

◆ TargetFollowerCount

int32 USubscriptionAlertPresenter::TargetFollowerCount = 0
private

이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: