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

#include <ChatViewWidget.h>

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

Protected 멤버 함수

virtual void NativeConstruct () override
 
virtual void NativeDestruct () override
 
virtual void NativeTick (const FGeometry &MyGeometry, float InDeltaTime) override
 
void HandleConstellationReaction (UConstellationBase *Constellation, const FText &ChatText, bool bTagged)
 
void UpdateScrollInteraction ()
 
void OnBubbleAdded (UChatBubbleWidget *Bubble, UConstellationBase *Constellation, bool bTagged)
 
- UUserWidgetBase(으)로부터 상속된 Protected 멤버 함수
virtual void OnWidgetActivated ()
 
virtual void OnWidgetDeactivated ()
 
void OnPushedToLayer_Internal ()
 
void OnPoppedFromLayer_Internal ()
 
void OnActivated_Internal ()
 
void OnDeactivated_Internal ()
 

Protected 속성

TObjectPtr< UScrollBox > ChatScrollBox
 
TSubclassOf< UChatBubbleWidgetChatBubbleClass
 
- UUserWidgetBase(으)로부터 상속된 Protected 속성
EWidgetState WidgetState
 
TObjectPtr< UAbilitySystemComponent > ASC
 
FGameplayTag LayerTag
 
bool bPrimary = false
 
TObjectPtr< UWidgetAnimation > AppearanceAnim
 
TObjectPtr< UWidgetAnimation > DisappearanceAnim
 

Private 속성

uint8 bScrollInteractionEnabled: 1 = false
 

추가로 상속된 멤버들

- UUserWidgetBase(으)로부터 상속된 Public 멤버 함수
virtual void SetAbilitySystemComponent (AActor *InOwner)
 
virtual UAbilitySystemComponent * GetAbilitySystemComponent () const override
 
virtual void OnPushedToLayer ()
 
virtual void OnPoppedFromLayer ()
 
virtual void OnActivated ()
 
virtual void OnDeactivated ()
 
void Activate ()
 
void Deactivate ()
 
FORCEINLINE FGameplayTag GetLayerTag () const
 
FORCEINLINE void SetLayerTag (const FGameplayTag InTag)
 
FORCEINLINE bool IsPrimary () const
 
FORCEINLINE void SetPrimary (const bool InPrimary)
 
FORCEINLINE EWidgetState GetWidgetState () const
 
FORCEINLINE void SetWidgetState (const EWidgetState InState)
 
FORCEINLINE UWaitForWidgetActivationGetActivationHandle ()
 
FORCEINLINE bool HasAppearanceAnim () const
 
FORCEINLINE bool HasDisappearanceAnim () const
 

상세한 설명

성좌들의 반응이 쌓이는 채팅창. 커서가 떠 있을 때만 스크롤 조작을 받고, 새 반응이 오면 항상 최하단으로 내려간다.

멤버 함수 문서화

◆ HandleConstellationReaction()

void UChatViewWidget::HandleConstellationReaction ( UConstellationBase Constellation,
const FText &  ChatText,
bool  bTagged 
)
protected
74{
75 if (Constellation == nullptr || ChatScrollBox == nullptr)
76 {
77 return;
78 }
79
80 if (ChatBubbleClass == nullptr)
81 {
82 LOG_WARNING(LogCK, "ChatBubbleClass 가 비어 있어 채팅 버블을 만들 수 없습니다.");
83 return;
84 }
85
86 UChatBubbleWidget* Bubble = CreateWidget<UChatBubbleWidget>(GetOwningPlayer(), ChatBubbleClass);
87 if (Bubble == nullptr)
88 {
89 return;
90 }
91
92 const FConstellationData& Data = Constellation->GetConstellationData();
93
94 // 아이콘은 소프트 참조라 표시 직전에 로드한다.
95 UTexture2D* Icon = Data.Icon.LoadSynchronous();
96
97 Bubble->SetupBubble(Icon, Constellation->BuildDisplayName(), ChatText, bTagged);
98
99 ChatScrollBox->AddChild(Bubble);
100
101 // 화면에 남길 줄 수는 기획 수치라 설정에서 읽는다. 대기열을 버리는 규칙과는 별개의 처리다.
102 const int32 MaxBubbleCount = GetDefault<UConstellationSettings>()->GetMaxVisibleChatCount();
103
104 // 오래된 버블부터 정리해 목록이 무한정 늘어나지 않게 한다.
105 while (ChatScrollBox->GetChildrenCount() > MaxBubbleCount)
106 {
107 ChatScrollBox->RemoveChildAt(0);
108 }
109
110 // 방금 온 반응이 보이도록 항상 최하단으로 내린다.
111 ChatScrollBox->ScrollToEnd();
112
113 OnBubbleAdded(Bubble, Constellation, bTagged);
114}
#define LOG_WARNING(Category, Format,...)
Definition CK_UE.h:39
Definition ChatBubbleWidget.h:18
void SetupBubble(UTexture2D *InIcon, const FText &InConstellationName, const FText &InChatText, bool bTagged)
Definition ChatBubbleWidget.cpp:11
TSubclassOf< UChatBubbleWidget > ChatBubbleClass
Definition ChatViewWidget.h:43
TObjectPtr< UScrollBox > ChatScrollBox
Definition ChatViewWidget.h:40
void OnBubbleAdded(UChatBubbleWidget *Bubble, UConstellationBase *Constellation, bool bTagged)
FORCEINLINE const FConstellationData & GetConstellationData() const
Definition ConstellationBase.h:53
FText BuildDisplayName() const
Definition ConstellationBase.cpp:20
Definition ConstellationData.h:16
TSoftObjectPtr< UTexture2D > Icon
Definition ConstellationData.h:46
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ NativeConstruct()

void UChatViewWidget::NativeConstruct ( )
overrideprotectedvirtual
17{
18 Super::NativeConstruct();
19
20 if (UStreamingSubsystem* ConstellationSubsystem = GetWorld()->GetSubsystem<UStreamingSubsystem>())
21 {
22 ConstellationSubsystem->OnConstellationReaction.AddUObject(this, &UChatViewWidget::HandleConstellationReaction);
23 }
24
25 // 초기 상태를 커서에 맞춰 한 번 맞춰둔다.
28}
uint8 bScrollInteractionEnabled
Definition ChatViewWidget.h:47
void UpdateScrollInteraction()
Definition ChatViewWidget.cpp:50
void HandleConstellationReaction(UConstellationBase *Constellation, const FText &ChatText, bool bTagged)
Definition ChatViewWidget.cpp:73
Definition StreamingSubsystem.h:73
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ NativeDestruct()

void UChatViewWidget::NativeDestruct ( )
overrideprotectedvirtual
32{
33 if (UStreamingSubsystem* ConstellationSubsystem = GetWorld()->GetSubsystem<UStreamingSubsystem>())
34 {
35 ConstellationSubsystem->OnConstellationReaction.RemoveAll(this);
36 }
37
38 Super::NativeDestruct();
39}

◆ NativeTick()

void UChatViewWidget::NativeTick ( const FGeometry &  MyGeometry,
float  InDeltaTime 
)
overrideprotectedvirtual
43{
44 Super::NativeTick(MyGeometry, InDeltaTime);
45
47}
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ OnBubbleAdded()

void UChatViewWidget::OnBubbleAdded ( UChatBubbleWidget Bubble,
UConstellationBase Constellation,
bool  bTagged 
)
protected
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateScrollInteraction()

void UChatViewWidget::UpdateScrollInteraction ( )
protected
51{
52 if (ChatScrollBox == nullptr)
53 {
54 return;
55 }
56
57 const APlayerController* OwningPlayer = GetOwningPlayer();
58 const bool bShouldEnable = OwningPlayer && OwningPlayer->bShowMouseCursor;
59
60 // 상태가 그대로면 Visibility 를 건드리지 않는다. (레이아웃 무효화 비용 회피)
61 if (bShouldEnable == bScrollInteractionEnabled)
62 {
63 return;
64 }
65
66 bScrollInteractionEnabled = bShouldEnable;
67
68 // 커서가 없을 때는 입력을 통과시켜 조준 등 다른 조작을 막지 않는다.
69 ChatScrollBox->SetVisibility(bShouldEnable ? ESlateVisibility::Visible : ESlateVisibility::HitTestInvisible);
70}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ bScrollInteractionEnabled

uint8 UChatViewWidget::bScrollInteractionEnabled
private

◆ ChatBubbleClass

TSubclassOf<UChatBubbleWidget> UChatViewWidget::ChatBubbleClass
protected

◆ ChatScrollBox

TObjectPtr<UScrollBox> UChatViewWidget::ChatScrollBox
protected

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