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

#include <DialogPresenter.h>

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

Public 멤버 함수

virtual void InitializePresenter (UUIManagementSubsystem *Subsystem) override
 
virtual void DeinitializePresenter () override
 
virtual void OnViewBound (UUserWidgetBase *View) override
 
virtual void OnViewUnbound (UUserWidgetBase *View) override
 
virtual bool ShouldReceiveStageEvent_Implementation (const FStageEventMessage &Message, const FInstancedStruct &ListenerContext) override
 
virtual void HandleStageEvent_Implementation (const FStageEventMessage &Message, const FInstancedStruct &ListenerContext) override
 
bool StartScenario (FName ScenarioID)
 
bool SetDialogData (UDialogData *Data)
 
void AdvanceDialog ()
 
void BeginSkipHold ()
 
void ConfirmSkipHold ()
 
FORCEINLINE void CancelSkipHold ()
 
void SkipRemainingRows ()
 
bool IsDialogInputAvailable () const
 
void RefreshInput ()
 
void CompletePresentation (int32 RequestID)
 
FORCEINLINE EDialogState GetDialogState () const
 
FORCEINLINE TSharedPtr< FRichTextRevealState > GetRevealState () const
 
- UUserPresenterBase(으)로부터 상속된 Public 멤버 함수
virtual UWorld * GetWorld () const override
 
FORCEINLINE UUIManagementSubsystem * GetUISubsystem () const
 
void SetInputKeys (APlayerController *PlayerController, const TArray< FKey > &Keys, int32 Priority=100)
 
void DisableInput ()
 
- IStageEventBehaviorInterface(으)로부터 상속된 Public 멤버 함수
void HandleStageEvent (const FStageEventMessage &Message, const FInstancedStruct &ListenerContext)
 
bool ShouldReceiveStageEvent (const FStageEventMessage &Message, const FInstancedStruct &ListenerContext)
 

Public 속성

FOnDialogPresentationRequested OnPresentationRequested
 
FOnIllustratedDialogLineChanged OnLineChanged
 
FOnIllustratedDialogRefresh OnTextRefresh
 
FOnIllustratedDialogFinished OnDialogFinished
 

Protected 속성

TSoftObjectPtr< UDialogData > DialogDataAsset
 
float CharactersPerSecond = 40.0f
 

Private 멤버 함수

void LoadData ()
 
void OnDataLoaded (TSharedPtr< FStreamableHandle > Handle)
 
void TryStartScenario ()
 
void ShowCurrentRow ()
 
void PresentCurrentRow ()
 
void RequestPresentation (EDialogState NewState, EDialogPresentation Presentation, bool bPlayer=false)
 
void StartTyping ()
 
void StopTyping ()
 
bool UpdateTyping (float DeltaTime)
 
void FinishTyping ()
 
void CompleteRow ()
 
void BeginClosing ()
 
void FinishDialog ()
 
void ResetRuntime ()
 
void DispatchRowEvent (FName EventID)
 

Private 속성

TObjectPtr< UDialogData > LoadedData
 
FStageEventMessage ScenarioMessage
 
TWeakObjectPtr< UUserWidgetBase > ActiveView
 
TSharedPtr< FStreamableHandle > LoadHandle
 
TSharedPtr< FRichTextRevealState > RevealState
 
FTSTicker::FDelegateHandle TypingTicker
 
TArray< FDT_DialogTable > Rows
 
FName CurrentCharacterID
 
FName PendingEndEvent
 
EDialogState State = EDialogState::Idle
 
int32 RowIndex = 0
 
int32 PresentationID = 0
 
float TypingProgress = 0.0f
 
bool bCurrentPlayer = false
 
bool bInputEnabled = false
 
bool bSkipArmed = false
 
bool bClosing = false
 
bool bDispatching = false
 

추가로 상속된 멤버들

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

상세한 설명

일러스트 대화의 데이터·타이핑·입력 수명과 연출 순서를 관리합니다.

멤버 함수 문서화

◆ AdvanceDialog()

void UDialogPresenter::AdvanceDialog ( )

IA_Continue의 Started에 연결합니다. 한 번의 입력은 한 단계만 처리합니다.

437{
438 if (IsDialogInputAvailable() == false || bDispatching)
439 {
440 return;
441 }
442
444 {
445 FinishTyping();
446 }
448 {
450 }
451}
bool bDispatching
Definition DialogPresenter.h:177
EDialogState State
Definition DialogPresenter.h:169
void FinishTyping()
Definition DialogPresenter.cpp:427
bool IsDialogInputAvailable() const
Definition DialogPresenter.cpp:562
bool bCurrentPlayer
Definition DialogPresenter.h:173
void RequestPresentation(EDialogState NewState, EDialogPresentation Presentation, bool bPlayer=false)
Definition DialogPresenter.cpp:257

다음을 참조함 : bCurrentPlayer, bDispatching, BubbleExit, FinishTyping(), IsDialogInputAvailable(), RequestPresentation(), State, Typing, WaitingInput.

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

◆ BeginClosing()

void UDialogPresenter::BeginClosing ( )
private
516{
517 bClosing = true;
518
519 if (CurrentCharacterID.IsNone() == false)
520 {
522 }
523 else
524 {
525 FinishDialog();
526 }
527}
FName CurrentCharacterID
Definition DialogPresenter.h:167
void FinishDialog()
Definition DialogPresenter.cpp:530
bool bClosing
Definition DialogPresenter.h:176

다음을 참조함 : bClosing, bCurrentPlayer, CharacterExit, ClosingCharacter, CurrentCharacterID, FinishDialog(), RequestPresentation().

다음에 의해서 참조됨 : CompletePresentation(), ShowCurrentRow().

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

◆ BeginSkipHold()

void UDialogPresenter::BeginSkipHold ( )

IA_Skip의 Started / Triggered / Completed 및 Canceled에 각각 연결합니다.

455{
457}
bool bSkipArmed
Definition DialogPresenter.h:175

다음을 참조함 : bClosing, bSkipArmed, IsDialogInputAvailable().

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

◆ CancelSkipHold()

FORCEINLINE void UDialogPresenter::CancelSkipHold ( )
inline
90 {
91 bSkipArmed = false;
92 }

다음에 의해서 참조됨 : ConfirmSkipHold(), RefreshInput().

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

◆ CompletePresentation()

void UDialogPresenter::CompletePresentation ( int32  RequestID)

View의 완료 델리게이트 수신부입니다. 이전 연출의 지연 콜백은 무시합니다.

266{
267 if (RequestID != PresentationID || ActiveView.IsValid() == false)
268 {
269 return;
270 }
271
272 switch (State)
273 {
275 {
276 CurrentCharacterID = NAME_None;
278 break;
279 }
280
282 {
284 break;
285 }
286
288 {
289 StartTyping();
290 break;
291 }
292
294 {
295 if (bClosing)
296 {
297 BeginClosing();
298 return;
299 }
300
301 CompleteRow();
302
304 {
306 }
307
308 break;
309 }
310
312 {
313 CurrentCharacterID = NAME_None;
314 BeginClosing();
315 break;
316 }
317
318 default:
319 {
320 break;
321 }
322 }
323}
int32 PresentationID
Definition DialogPresenter.h:171
void BeginClosing()
Definition DialogPresenter.cpp:515
TWeakObjectPtr< UUserWidgetBase > ActiveView
Definition DialogPresenter.h:162
void CompleteRow()
Definition DialogPresenter.cpp:493
void StartTyping()
Definition DialogPresenter.cpp:389
void ShowCurrentRow()
Definition DialogPresenter.cpp:326

다음을 참조함 : ActiveView, bClosing, bCurrentPlayer, BeginClosing(), BubbleEnter, BubbleExit, CharacterEnter, CharacterExit, ClosingCharacter, CompleteRow(), CurrentCharacterID, PresentationID, RequestPresentation(), ShowCurrentRow(), StartTyping(), State.

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

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

◆ CompleteRow()

void UDialogPresenter::CompleteRow ( )
private
494{
495 if (Rows.IsValidIndex(RowIndex) == false)
496 {
497 return;
498 }
499
500 const FName EventID = Rows[RowIndex++].Event_ID;
501
502 if (RowIndex == Rows.Num())
503 {
504 // 마지막 이벤트가 View를 제거하더라도 말풍선과 캐릭터의 퇴장은 먼저 완료합니다.
505 PendingEndEvent = EventID;
506 return;
507 }
508
509 bDispatching = true;
510 DispatchRowEvent(EventID);
511 bDispatching = false;
512}
TArray< FDT_DialogTable > Rows
Definition DialogPresenter.h:166
FName PendingEndEvent
Definition DialogPresenter.h:168
void DispatchRowEvent(FName EventID)
Definition DialogPresenter.cpp:609
int32 RowIndex
Definition DialogPresenter.h:170

다음을 참조함 : bDispatching, DispatchRowEvent(), PendingEndEvent, RowIndex, Rows.

다음에 의해서 참조됨 : CompletePresentation(), SkipRemainingRows().

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

◆ ConfirmSkipHold()

void UDialogPresenter::ConfirmSkipHold ( )
461{
462 if (bSkipArmed)
463 {
466 }
467}
FORCEINLINE void CancelSkipHold()
Definition DialogPresenter.h:89
void SkipRemainingRows()
Definition DialogPresenter.cpp:470

다음을 참조함 : bSkipArmed, CancelSkipHold(), SkipRemainingRows().

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

◆ DeinitializePresenter()

void UDialogPresenter::DeinitializePresenter ( )
overridevirtual

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

108{
110 {
111 UI->GetOnInputLayerChanged().RemoveDynamic(this, &ThisClass::RefreshInput);
112 }
113
114 if (UUserWidgetBase* View = ActiveView.Get())
115 {
116 View->OnNativeVisibilityChanged.RemoveAll(this);
117 }
118
119 ActiveView.Reset();
120 ResetRuntime();
121
122 if (LoadHandle.IsValid())
123 {
124 LoadHandle->CancelHandle();
125 LoadHandle.Reset();
126 }
127
128 LoadedData = nullptr;
130 OnLineChanged.Clear();
131 OnTextRefresh.Clear();
132 OnDialogFinished.Clear();
133 Super::DeinitializePresenter();
134}
TSharedPtr< FStreamableHandle > LoadHandle
Definition DialogPresenter.h:163
FOnIllustratedDialogFinished OnDialogFinished
Definition DialogPresenter.h:130
FOnIllustratedDialogLineChanged OnLineChanged
Definition DialogPresenter.h:124
FOnDialogPresentationRequested OnPresentationRequested
Definition DialogPresenter.h:121
void ResetRuntime()
Definition DialogPresenter.cpp:548
FOnIllustratedDialogRefresh OnTextRefresh
Definition DialogPresenter.h:127
TObjectPtr< UDialogData > LoadedData
Definition DialogPresenter.h:157
Definition UIManagementSubsystem.h:28
FORCEINLINE UUIManagementSubsystem * GetUISubsystem() const
Definition UserPresenterBase.h:32
Definition UserWidgetBase.h:35

다음을 참조함 : ActiveView, UUserPresenterBase::GetUISubsystem(), LoadedData, LoadHandle, OnDialogFinished, OnLineChanged, OnPresentationRequested, OnTextRefresh, ResetRuntime().

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

◆ DispatchRowEvent()

void UDialogPresenter::DispatchRowEvent ( FName  EventID)
private
610{
611 if (EventID.IsNone() || ActiveView.IsValid() == false)
612 {
613 return;
614 }
615
616 APlayerController* Controller = ActiveView->GetOwningPlayer();
617 UWorld* World = ActiveView->GetWorld();
618
619 if (Controller == nullptr || Controller->HasAuthority() == false || World == nullptr)
620 {
621 return;
622 }
623
624 if (UStageSubsystem* Stage = World->GetSubsystem<UStageSubsystem>())
625 {
627 Message.EventID = EventID;
628 Message.TimeSeconds = World->GetTimeSeconds();
629 Stage->DispatchStageEvent(Message, Message.Instigator.Get());
630 }
631}
FStageEventMessage ScenarioMessage
Definition DialogPresenter.h:160
Definition StageSubsystem.h:102
Definition StageEventMessage.h:14
float TimeSeconds
Definition StageEventMessage.h:44
FName EventID
Definition StageEventMessage.h:24
TWeakObjectPtr< AActor > Instigator
Definition StageEventMessage.h:31

다음을 참조함 : ActiveView, FStageEventMessage::EventID, FStageEventMessage::Instigator, ScenarioMessage, FStageEventMessage::TimeSeconds.

다음에 의해서 참조됨 : CompleteRow(), FinishDialog().

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

◆ FinishDialog()

void UDialogPresenter::FinishDialog ( )
private
531{
533 const FName EndEvent = PendingEndEvent;
534 PendingEndEvent = NAME_None;
535 bDispatching = true;
536 DispatchRowEvent(EndEvent);
537 bDispatching = false;
539 RefreshInput();
540
541 if (ActiveView.IsValid())
542 {
543 OnDialogFinished.Broadcast();
544 }
545}
void RefreshInput()
Definition DialogPresenter.cpp:582

다음을 참조함 : ActiveView, bDispatching, DispatchRowEvent(), Finished, OnDialogFinished, PendingEndEvent, RefreshInput(), ScenarioMessage, State.

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

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

◆ FinishTyping()

void UDialogPresenter::FinishTyping ( )
private
428{
429 StopTyping();
431 RevealState->SetVisibleCharacterCount(MAX_int32);
432 OnTextRefresh.Broadcast();
433}
TSharedPtr< FRichTextRevealState > RevealState
Definition DialogPresenter.h:164
void StopTyping()
Definition DialogPresenter.cpp:404

다음을 참조함 : OnTextRefresh, RevealState, State, StopTyping(), WaitingInput.

다음에 의해서 참조됨 : AdvanceDialog(), StartTyping(), UpdateTyping().

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

◆ GetDialogState()

FORCEINLINE EDialogState UDialogPresenter::GetDialogState ( ) const
inline
109 {
110 return State;
111 }

◆ GetRevealState()

FORCEINLINE TSharedPtr< FRichTextRevealState > UDialogPresenter::GetRevealState ( ) const
inline
115 {
116 return RevealState;
117 }

◆ HandleStageEvent_Implementation()

void UDialogPresenter::HandleStageEvent_Implementation ( const FStageEventMessage &  Message,
const FInstancedStruct &  ListenerContext 
)
overridevirtual

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

181{
182 if (ShouldReceiveStageEvent_Implementation(Message, ListenerContext))
183 {
184 ScenarioMessage = Message;
186 }
187}
virtual bool ShouldReceiveStageEvent_Implementation(const FStageEventMessage &Message, const FInstancedStruct &ListenerContext) override
Definition DialogPresenter.cpp:172
void TryStartScenario()
Definition DialogPresenter.cpp:212

다음을 참조함 : ScenarioMessage, ShouldReceiveStageEvent_Implementation(), TryStartScenario().

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

◆ InitializePresenter()

void UDialogPresenter::InitializePresenter ( UUIManagementSubsystem *  Subsystem)
overridevirtual

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

17{
18 Super::InitializePresenter(Subsystem);
19 Subsystem->GetOnInputLayerChanged().AddUniqueDynamic(this, &ThisClass::RefreshInput);
20 LoadData();
21}
void LoadData()
Definition DialogPresenter.cpp:24
FORCEINLINE FOnInputLayerChanged & GetOnInputLayerChanged()
Definition UIManagementSubsystem.h:170

다음을 참조함 : UUIManagementSubsystem::GetOnInputLayerChanged(), LoadData().

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

◆ IsDialogInputAvailable()

bool UDialogPresenter::IsDialogInputAvailable ( ) const
563{
565 const UUserWidgetBase* View = ActiveView.Get();
566
567 if (UI == nullptr || View == nullptr || View->GetWidgetState() != EWidgetState::Appeared || View->IsVisible() == false)
568 {
569 return false;
570 }
571
573 {
574 return false;
575 }
576
577 const UUISettings* Settings = UUISettings::Get();
578 return Settings->GetLayerPriority(UI->GetActivePresenterInputLayer()) <= Settings->GetLayerPriority(View->GetLayerTag());
579}
FGameplayTag GetActivePresenterInputLayer() const
Definition UIManagementSubsystem.cpp:930
Definition UISettings.h:49
int32 GetLayerPriority(const FGameplayTag &LayerTag) const
Definition UISettings.h:64
static const UUISettings * Get()
Definition UISettings.h:53
FORCEINLINE EWidgetState GetWidgetState() const
Definition UserWidgetBase.h:108
FORCEINLINE FGameplayTag GetLayerTag() const
Definition UserWidgetBase.h:88

다음을 참조함 : ActiveView, Appeared, Finished, UUISettings::Get(), UUIManagementSubsystem::GetActivePresenterInputLayer(), UUISettings::GetLayerPriority(), UUserWidgetBase::GetLayerTag(), UUserPresenterBase::GetUISubsystem(), UUserWidgetBase::GetWidgetState(), Idle, State.

다음에 의해서 참조됨 : AdvanceDialog(), BeginSkipHold(), RefreshInput(), SkipRemainingRows().

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

◆ LoadData()

void UDialogPresenter::LoadData ( )
private
25{
26 if (DialogDataAsset.IsNull() || LoadHandle.IsValid())
27 {
28 return;
29 }
30
31 UAssetManager& Manager = UAssetManager::Get();
32 const FPrimaryAssetId AssetID = Manager.GetPrimaryAssetIdForPath(DialogDataAsset.ToSoftObjectPath());
33
34 if (AssetID.IsValid() == false)
35 {
36 LOG_ERROR(LogDialog, "DialogData를 Primary Asset으로 등록해야 합니다: %s", *DialogDataAsset.ToString());
37 return;
38 }
39
40 FAssetManagerLoadParams Params;
41 LoadHandle = Manager.PreloadPrimaryAssets({ AssetID }, { FName(TEXT("Dialog")) }, false, MoveTemp(Params));
42
43 if (LoadHandle.IsValid() == false)
44 {
45 return;
46 }
47
48 if (LoadHandle->HasLoadCompleted())
49 {
51 }
52 else
53 {
54 LoadHandle->BindCompleteDelegate(FStreamableDelegateWithHandle::CreateUObject(this, &ThisClass::OnDataLoaded));
55 }
56}
#define LOG_ERROR(Category, Format,...)
Definition CK_UE.h:41
TSoftObjectPtr< UDialogData > DialogDataAsset
Definition DialogPresenter.h:134
void OnDataLoaded(TSharedPtr< FStreamableHandle > Handle)
Definition DialogPresenter.cpp:59

다음을 참조함 : DialogDataAsset, LoadHandle, LOG_ERROR, OnDataLoaded().

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

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

◆ OnDataLoaded()

void UDialogPresenter::OnDataLoaded ( TSharedPtr< FStreamableHandle >  Handle)
private
60{
61 if (Handle != LoadHandle || Handle.IsValid() == false)
62 {
63 return;
64 }
65
66 if (! Handle->HasError() && SetDialogData(DialogDataAsset.Get()) != false)
67 {
68 return;
69 }
70
71 LOG_ERROR(LogDialog, "Dialog 번들 또는 DT_DialogTable 로드에 실패했습니다.");
72 LoadedData = nullptr;
73 Handle->ReleaseHandle();
74 LoadHandle.Reset();
75}
bool SetDialogData(UDialogData *Data)
Definition DialogPresenter.cpp:78

다음을 참조함 : DialogDataAsset, LoadedData, LoadHandle, LOG_ERROR, SetDialogData().

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

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

◆ OnViewBound()

void UDialogPresenter::OnViewBound ( UUserWidgetBase *  View)
overridevirtual

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

138{
139 ActiveView = View;
140
141 if (View)
142 {
143 View->OnNativeVisibilityChanged.AddWeakLambda(this, [this](ESlateVisibility)
144 {
145 RefreshInput();
146 });
147 }
148
149 Super::OnViewBound(View);
151 RefreshInput();
152}

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

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

◆ OnViewUnbound()

void UDialogPresenter::OnViewUnbound ( UUserWidgetBase *  View)
overridevirtual

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

156{
157 if (View)
158 {
159 View->OnNativeVisibilityChanged.RemoveAll(this);
160 }
161
162 if (ActiveView.Get() == View)
163 {
164 ActiveView.Reset();
165 ResetRuntime();
166 }
167
168 Super::OnViewUnbound(View);
169}

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

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

◆ PresentCurrentRow()

void UDialogPresenter::PresentCurrentRow ( )
private
367{
368 const FDT_DialogTable Row = Rows[RowIndex];
369 UTexture2D* Image = nullptr;
370 bool bDefaultImage = false;
371
372 if (const FDialogCharacterImages* Images = LoadedData->Characters.Find(Row.Character_ID))
373 {
374 const TSoftObjectPtr<UTexture2D>* Emotion = Images->EmotionImages.Find(Row.Character_Emotion);
375 Image = Emotion ? Emotion->Get() : nullptr;
376 bDefaultImage = Image != nullptr;
377 Image = bDefaultImage ? Image : Images->DefaultImage.Get();
378 }
379
380 if (bDefaultImage)
381 {
382 LOG_WARNING(LogDialog, "캐릭터 일러스트를 찾지 못해 기본 이미지를 사용합니다. %s / %s", *Row.Character_ID.ToString(), *Row.Character_Emotion.ToString());
383 }
384
385 OnLineChanged.Broadcast(Row, Image, bCurrentPlayer);
386}
#define LOG_WARNING(Category, Format,...)
Definition CK_UE.h:40
Definition DT_DialogTable.h:11
FName Character_ID
Definition DT_DialogTable.h:33
FName Character_Emotion
Definition DT_DialogTable.h:36
Definition DialogData.h:15

다음을 참조함 : bCurrentPlayer, FDT_DialogTable::Character_Emotion, FDT_DialogTable::Character_ID, LoadedData, LOG_WARNING, OnLineChanged, RowIndex, Rows.

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

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

◆ RefreshInput()

void UDialogPresenter::RefreshInput ( )
583{
584 const bool bEnable = IsDialogInputAvailable();
585
586 if (bEnable == false || bClosing)
587 {
589 }
590
591 if (bInputEnabled == bEnable)
592 {
593 return;
594 }
595
596 bInputEnabled = bEnable;
597
598 if (bEnable)
599 {
600 SetInputKeys(ActiveView->GetOwningPlayer(), { }, 100);
601 }
602 else
603 {
604 DisableInput();
605 }
606}
bool bInputEnabled
Definition DialogPresenter.h:174
void SetInputKeys(APlayerController *PlayerController, const TArray< FKey > &Keys, int32 Priority=100)
Definition UserPresenterBase.cpp:66
void DisableInput()
Definition UserPresenterBase.cpp:104

다음을 참조함 : ActiveView, bClosing, bInputEnabled, CancelSkipHold(), UUserPresenterBase::DisableInput(), IsDialogInputAvailable(), UUserPresenterBase::SetInputKeys().

다음에 의해서 참조됨 : FinishDialog(), OnViewBound(), RequestPresentation(), ResetRuntime(), StartTyping().

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

◆ RequestPresentation()

void UDialogPresenter::RequestPresentation ( EDialogState  NewState,
EDialogPresentation  Presentation,
bool  bPlayer = false 
)
private
258{
259 State = NewState;
260 RefreshInput();
261 OnPresentationRequested.Broadcast(Presentation, bPlayer, ++PresentationID);
262}

다음을 참조함 : OnPresentationRequested, PresentationID, RefreshInput(), State.

다음에 의해서 참조됨 : AdvanceDialog(), BeginClosing(), CompletePresentation(), ShowCurrentRow(), SkipRemainingRows().

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

◆ ResetRuntime()

void UDialogPresenter::ResetRuntime ( )
private
549{
550 StopTyping();
553 Rows.Reset();
554 RevealState.Reset();
556 PendingEndEvent = NAME_None;
557 bClosing = false;
558 RefreshInput();
559}

다음을 참조함 : bClosing, Idle, PendingEndEvent, PresentationID, RefreshInput(), RevealState, Rows, ScenarioMessage, State, StopTyping().

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

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

◆ SetDialogData()

bool UDialogPresenter::SetDialogData ( UDialogData *  Data)

로드된 설정을 연결합니다. 진행 중인 대화의 설정 교체는 허용하지 않습니다.

79{
80 UDataTable* Table;
81
82 if (Data)
83 {
84 Table = Data->DialogTable.Get();
85 }
86 else
87 {
88 Table = nullptr;
89 }
90
91 if (Table == nullptr || Table->GetRowStruct() != FDT_DialogTable::StaticStruct())
92 {
93 return false;
94 }
95
97 {
98 return false;
99 }
100
101 LoadedData = Data;
103 return true;
104}
TSoftObjectPtr< UDataTable > DialogTable
Definition DialogData.h:41

다음을 참조함 : UDialogData::DialogTable, Finished, Idle, LoadedData, State, TryStartScenario().

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

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

◆ ShouldReceiveStageEvent_Implementation()

bool UDialogPresenter::ShouldReceiveStageEvent_Implementation ( const FStageEventMessage &  Message,
const FInstancedStruct &  ListenerContext 
)
overridevirtual

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

173{
174 return Message.EventID.IsNone() == false &&
175 ScenarioMessage.EventID.IsNone() && bDispatching == false &&
177}

다음을 참조함 : bDispatching, FStageEventMessage::EventID, Finished, Idle, ScenarioMessage, State.

다음에 의해서 참조됨 : HandleStageEvent_Implementation(), StartScenario().

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

◆ ShowCurrentRow()

void UDialogPresenter::ShowCurrentRow ( )
private
327{
328 if (Rows.IsValidIndex(RowIndex) == false)
329 {
330 BeginClosing();
331 return;
332 }
333
334 const FDT_DialogTable& Row = Rows[RowIndex];
335
336 if (CurrentCharacterID.IsNone() == false && CurrentCharacterID != Row.Character_ID)
337 {
339 return;
340 }
341
342 // 퇴장까지는 이전 발언자의 구분을 유지하고, 새 대사를 적용할 때 갱신합니다.
343 bCurrentPlayer = LoadedData->PlayerCharacterID.IsNone() == false && Row.Character_ID == LoadedData->PlayerCharacterID;
344 const bool bEntering = CurrentCharacterID.IsNone();
346 RevealState = MakeShared<FRichTextRevealState>();
347 TypingProgress = 0.0f;
349
350 if (ActiveView.IsValid() == false)
351 {
352 return;
353 }
354
355 if (bEntering)
356 {
358 }
359 else
360 {
362 }
363}
EDialogPresentation
Definition DialogPresenter.h:19
void PresentCurrentRow()
Definition DialogPresenter.cpp:366
float TypingProgress
Definition DialogPresenter.h:172

다음을 참조함 : ActiveView, bCurrentPlayer, BeginClosing(), BubbleEnter, FDT_DialogTable::Character_ID, CharacterEnter, CharacterExit, CurrentCharacterID, LoadedData, PresentCurrentRow(), RequestPresentation(), RevealState, RowIndex, Rows, TypingProgress.

다음에 의해서 참조됨 : CompletePresentation(), TryStartScenario().

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

◆ SkipRemainingRows()

void UDialogPresenter::SkipRemainingRows ( )
471{
472 if (IsDialogInputAvailable() == false || bClosing || bDispatching)
473 {
474 return;
475 }
476
477 StopTyping();
478 bClosing = true;
479
480 // Messenger와 동일하게 건너뛴 행의 이벤트도 한 번씩 전달합니다.
481 while (ActiveView.IsValid() && Rows.IsValidIndex(RowIndex))
482 {
483 CompleteRow();
484 }
485
486 if (ActiveView.IsValid())
487 {
489 }
490}

다음을 참조함 : ActiveView, bClosing, bCurrentPlayer, bDispatching, BubbleExit, CompleteRow(), IsDialogInputAvailable(), RequestPresentation(), RowIndex, Rows, StopTyping().

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

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

◆ StartScenario()

bool UDialogPresenter::StartScenario ( FName  ScenarioID)

지정한 시나리오 하나를 시작합니다. 완료한 시나리오는 다시 재생할 수 있으며, 재생 중에는 다른 요청을 받지 않습니다.

191{
192 FStageEventMessage Message;
193 Message.EventID = ScenarioID;
194 Message.Sender = this;
195
196 if (ActiveView.IsValid() && ActiveView->GetOwningPlayer())
197 {
198 Message.Instigator = ActiveView->GetOwningPlayer()->GetPawn();
199 }
200
201 if (ShouldReceiveStageEvent_Implementation(Message, FInstancedStruct()) == false)
202 {
203 return false;
204 }
205
206 ScenarioMessage = Message;
208 return ScenarioMessage.EventID.IsNone() == false;
209}
TWeakObjectPtr< UObject > Sender
Definition StageEventMessage.h:28

다음을 참조함 : ActiveView, FStageEventMessage::EventID, FStageEventMessage::Instigator, ScenarioMessage, FStageEventMessage::Sender, ShouldReceiveStageEvent_Implementation(), TryStartScenario().

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

◆ StartTyping()

void UDialogPresenter::StartTyping ( )
private
390{
392 RefreshInput();
393
394 if (RevealState->GetCharacterCount() == 0)
395 {
396 FinishTyping();
397 return;
398 }
399
400 TypingTicker = FTSTicker::GetCoreTicker().AddTicker(FTickerDelegate::CreateUObject(this, &ThisClass::UpdateTyping));
401}
FTSTicker::FDelegateHandle TypingTicker
Definition DialogPresenter.h:165

다음을 참조함 : FinishTyping(), RefreshInput(), RevealState, State, Typing, TypingTicker.

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

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

◆ StopTyping()

void UDialogPresenter::StopTyping ( )
private
405{
406 FTSTicker::RemoveTicker(TypingTicker);
407 TypingTicker.Reset();
408}

다음을 참조함 : TypingTicker.

다음에 의해서 참조됨 : FinishTyping(), ResetRuntime(), SkipRemainingRows().

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

◆ TryStartScenario()

void UDialogPresenter::TryStartScenario ( )
private
213{
214 if (LoadedData == nullptr || ActiveView.IsValid() == false || ScenarioMessage.EventID.IsNone())
215 {
216 return;
217 }
218
220 {
221 return;
222 }
223
224 TArray<FDT_DialogTable*> TableRows;
225 LoadedData->DialogTable->GetAllRows(TEXT("DialogPresenter"), TableRows);
226 Rows.Reset();
227
228 for (const FDT_DialogTable* Row : TableRows)
229 {
230 if (Row && Row->Scenario_ID == ScenarioMessage.EventID)
231 {
232 Rows.Add(*Row);
233 }
234 }
235
236 Rows.Sort([](const FDT_DialogTable& A, const FDT_DialogTable& B)
237 {
238 return A.Dialog_ID < B.Dialog_ID;
239 });
240
241 if (Rows.IsEmpty())
242 {
243 LOG_WARNING(LogDialog, "대사를 찾을 수 없습니다: %s", *ScenarioMessage.EventID.ToString());
245 return;
246 }
247
248 RowIndex = 0;
249 bClosing = false;
250 CurrentCharacterID = NAME_None;
252
254}
int32 Dialog_ID
Definition DT_DialogTable.h:24

다음을 참조함 : ActiveView, bClosing, CurrentCharacterID, FDT_DialogTable::Dialog_ID, FStageEventMessage::EventID, Finished, Idle, LoadedData, LOG_WARNING, OnPresentationRequested, PresentationID, Reset, RowIndex, Rows, ScenarioMessage, ShowCurrentRow(), State.

다음에 의해서 참조됨 : HandleStageEvent_Implementation(), OnViewBound(), SetDialogData(), StartScenario().

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

◆ UpdateTyping()

bool UDialogPresenter::UpdateTyping ( float  DeltaTime)
private
412{
413 TypingProgress = FMath::Min(TypingProgress + DeltaTime * FMath::Max(CharactersPerSecond, 1.0f), static_cast<float>(RevealState->GetCharacterCount()));
414 RevealState->SetVisibleCharacterCount(FMath::FloorToInt(TypingProgress));
415
416 if (FMath::FloorToInt(TypingProgress) == RevealState->GetCharacterCount())
417 {
418 FinishTyping();
419 return false;
420 }
421
422 OnTextRefresh.Broadcast();
423 return State == EDialogState::Typing;
424}
float CharactersPerSecond
Definition DialogPresenter.h:137

다음을 참조함 : CharactersPerSecond, FinishTyping(), OnTextRefresh, RevealState, State, Typing, TypingProgress.

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

멤버 데이터 문서화

◆ ActiveView

◆ bClosing

bool UDialogPresenter::bClosing = false
private

◆ bCurrentPlayer

bool UDialogPresenter::bCurrentPlayer = false
private

◆ bDispatching

bool UDialogPresenter::bDispatching = false
private

◆ bInputEnabled

bool UDialogPresenter::bInputEnabled = false
private

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

◆ bSkipArmed

bool UDialogPresenter::bSkipArmed = false
private

다음에 의해서 참조됨 : BeginSkipHold(), ConfirmSkipHold().

◆ CharactersPerSecond

float UDialogPresenter::CharactersPerSecond = 40.0f
protected

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

◆ CurrentCharacterID

FName UDialogPresenter::CurrentCharacterID
private

◆ DialogDataAsset

TSoftObjectPtr<UDialogData> UDialogPresenter::DialogDataAsset
protected

다음에 의해서 참조됨 : LoadData(), OnDataLoaded().

◆ LoadedData

TObjectPtr<UDialogData> UDialogPresenter::LoadedData
private

◆ LoadHandle

TSharedPtr<FStreamableHandle> UDialogPresenter::LoadHandle
private

다음에 의해서 참조됨 : DeinitializePresenter(), LoadData(), OnDataLoaded().

◆ OnDialogFinished

FOnIllustratedDialogFinished UDialogPresenter::OnDialogFinished

◆ OnLineChanged

FOnIllustratedDialogLineChanged UDialogPresenter::OnLineChanged

◆ OnPresentationRequested

FOnDialogPresentationRequested UDialogPresenter::OnPresentationRequested

◆ OnTextRefresh

FOnIllustratedDialogRefresh UDialogPresenter::OnTextRefresh

◆ PendingEndEvent

FName UDialogPresenter::PendingEndEvent
private

다음에 의해서 참조됨 : CompleteRow(), FinishDialog(), ResetRuntime().

◆ PresentationID

int32 UDialogPresenter::PresentationID = 0
private

◆ RevealState

TSharedPtr<FRichTextRevealState> UDialogPresenter::RevealState
private

◆ RowIndex

int32 UDialogPresenter::RowIndex = 0
private

◆ Rows

TArray<FDT_DialogTable> UDialogPresenter::Rows
private

◆ ScenarioMessage

◆ State

◆ TypingProgress

float UDialogPresenter::TypingProgress = 0.0f
private

다음에 의해서 참조됨 : ShowCurrentRow(), UpdateTyping().

◆ TypingTicker

FTSTicker::FDelegateHandle UDialogPresenter::TypingTicker
private

다음에 의해서 참조됨 : StartTyping(), StopTyping().


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