10#include "Blueprint/WidgetBlueprintLibrary.h"
11#include "Components/MultiLineEditableTextBox.h"
12#include "Components/ScrollBox.h"
13#include "Components/ScrollBoxSlot.h"
14#include "Components/VerticalBox.h"
15#include "GameFramework/GameStateBase.h"
19 ConstructorHelpers::FClassFinder<UChatBoxWidget> LeftChatBoxWidgetClassRef(TEXT(
"/Game/CustomContents/UI/Widgets/Chat/WBP_LeftChatMessage.WBP_LeftChatMessage_C"));
20 if (LeftChatBoxWidgetClassRef.Succeeded())
24 ConstructorHelpers::FClassFinder<UChatBoxWidget> RightChatBoxWidgetClassRef(TEXT(
"/Game/CustomContents/UI/Widgets/Chat/WBP_RightChatMessage.WBP_RightChatMessage_C"));
25 if (RightChatBoxWidgetClassRef.Succeeded())
33 Super::NativeConstruct();
38 SetRenderOpacity(0.2f);
51 Super::NativeTick(MyGeometry, InDeltaTime);
79 auto* PC = Cast<APlayerControl>(GetWorld()->GetFirstPlayerController<APlayerController>());
82 PRINTLOG(TEXT(
"Cannot get playercontroller"));
87 bool bIsSender = (info.
id == sendUser.
id);
104 UScrollBoxSlot* parentSlot = Cast<UScrollBoxSlot>(newChat->Slot);
107 parentSlot->SetHorizontalAlignment((bIsSender ? HAlign_Left : HAlign_Right));
111 newChat->ForceLayoutPrepass();
121 if (bIsSender || scrollOffset == scrollOffsetOfEnd)
124 FTimerHandle ScrollTimerHandle;
125 GetWorld()->GetTimerManager().SetTimer(ScrollTimerHandle, [
this, newChat]()
128 ScrollBox_ChatBox->ScrollWidgetIntoView(newChat,
true, EDescendantScrollDestination::BottomOrRight);
135 UWidgetBlueprintLibrary::SetFocusToGameViewport();
136 PC->SetInputMode(FInputModeGameOnly());
137 PC->SetShowMouseCursor(
false);
142 SetRenderOpacity(1.0f);
155 SetRenderOpacity(1.0f);
172 SetRenderOpacity(1.0f);
APlayerControl 선언에 대한 Doxygen 주석을 제공합니다.
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
#define PRINTLOG(fmt,...)
FLinearColor GetChatProfileBg(int player_index) const
EResourceTextureType GetChatProfileTextureType(int player_index) const