KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
AMainLevelScriptActor.cpp
이 파일의 문서화 페이지로 가기
1// Copyright (c) 2025 Doppleddiggong. All rights reserved. Unauthorized copying, modification, or distribution of this file, via any medium is strictly prohibited. Proprietary and confidential.
2
3
5
7#include "GameLogging.h"
8#include "NetworkData.h"
10#include "UPopupManager.h"
11#include "UPopup_HowToPlay.h"
13#include "UPopup_LevelSelect.h"
14
15
17{
18 PrimaryActorTick.bCanEverTick = false;
19}
20
22{
23 Super::BeginPlay();
24
25 FTimerHandle TimerHandle;
26 GetWorldTimerManager().SetTimer(TimerHandle, [this]()
27 {
29 }, 1.0f, false);
30}
31
33{
34 if (auto Popup = UPopupManager::ShowPopupAs<UPopup_HowToPlay>(GetWorld(), EPopupType::HowToPlay))
35 {
36 TArray<EHowToPlayPageType> PageTypes;
37 PageTypes.Add(EHowToPlayPageType::Control_P1);
38 PageTypes.Add(EHowToPlayPageType::Control_P2);
39 PageTypes.Add(EHowToPlayPageType::Control_P3);
40 PageTypes.Add(EHowToPlayPageType::Control_P4);
41 PageTypes.Add(EHowToPlayPageType::Control_P5);
42 PageTypes.Add(EHowToPlayPageType::Control_P6);
43
44 Popup->InitPopup(PageTypes);
45
46 Popup->OnClosedDelegate.BindLambda([this]() {
47 this->StartProcess();
48 });
49 }
50}
51
52
54{
55 // Host(서버)인지 확인
56 if (HasAuthority())
57 {
58 // Host인 경우: 레벨 선택 팝업 표시
59 if (auto Popup = UPopupManager::ShowPopupAs<UPopup_LevelSelect>(GetWorld(), EPopupType::LevelSelect))
60 {
61 // 팝업 초기화
62 Popup->InitPopup();
63
64 // 팝업이 닫힐 때 RequestInterviewHello 호출
65 Popup->OnPopupClosed.BindLambda([this]()
66 {
68 });
69 }
70 else
71 {
72 PRINTLOG(TEXT("Failed to show LevelSelect popup"));
73 }
74 }
75 else
76 {
77 // Host가 아닌 경우: 바로 RequestInterviewHello 호출
79 }
80}
81
83{
84 // "오늘 보지 않기" 체크
86 return;
87
88 if (auto KLingoNetwork = UKLingoNetworkSystem::Get(GetWorld()))
89 {
90 KLingoNetwork->RequestInterviewHello( FResponseInterviewHelloDelegate::CreateUObject(this, &AMainLevelScriptActor::OnResponseInterviewHello) );
91 }
92 else
93 {
94 PRINTLOG(TEXT("UKLingoNetworkSystem not found!"));
95 }
96}
97
99{
100 if (bWasSuccessful)
101 {
102 if (auto Popup = UPopupManager::ShowPopupAs<UPopup_InterviewHello>(GetWorld(), EPopupType::InterviewHello))
103 Popup->InitPopup(ResponseData);
104 }
105 else
106 {
107 PRINTLOG(TEXT("--- InterviewHello Questions FAILED ---"));
108 }
109}
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
#define PRINTLOG(fmt,...)
Definition GameLogging.h:30
네트워크 요청과 응답에 사용되는 구조체 및 설정을 정의합니다.
KLingo API 요청을 담당하는 서브시스템을 선언합니다.
void OnResponseInterviewHello(FResponseInterviewHello &ResponseData, bool bWasSuccessful)
virtual void BeginPlay() override
static bool ShouldSkipInterviewToday(const UObject *WorldContextObject)
오늘 Interview 팝업을 건너뛸지 확인