KLingo Project Documentation
1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UPopup_SpeakQuest.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
4
#include "
UPopup_SpeakQuest.h
"
5
6
#include "
APlayerActor.h
"
7
#include "
UImageButton.h
"
8
#include "
UKLingoNetworkSystem.h
"
9
#include "
ULingoGameHelper.h
"
10
#include "
UPopupManager.h
"
11
12
void
UPopup_SpeakQuest::InitPopup
(
const
FOnMsgBoxOkDelegate& InOkDelegate)
13
{
14
// 중복 바인딩 방지: 기존 바인딩 제거 후 재바인딩
15
if
(
Btn_Ok
)
16
{
17
Btn_Ok
->OnButtonClickedEvent.RemoveDynamic(
this
, &
UPopup_SpeakQuest::OnClickOk
);
18
Btn_Ok
->OnButtonClickedEvent.AddDynamic(
this
, &
UPopup_SpeakQuest::OnClickOk
);
19
}
20
21
OnOkDelegate
= InOkDelegate;
22
23
24
RequestListenAudio
( TEXT(
"Please answer the officer’s question."
));
25
}
26
27
void
UPopup_SpeakQuest::RequestListenAudio
(
const
FString& AudioText)
28
{
29
if
(
bIsRequest
)
30
return
;
31
32
if
(
auto
KLingoNetwork = UKLingoNetworkSystem::Get(GetWorld()))
33
{
34
bIsRequest
=
true
;
35
36
KLingoNetwork->RequestListenAudio(
37
AudioText,
38
FResponseListenAudioDelegate::CreateUObject(
this
, &
UPopup_SpeakQuest::OnResponseListenAudio
)
39
);
40
}
41
}
42
43
void
UPopup_SpeakQuest::OnResponseListenAudio
(
FResponseListenAudio
& ResponseData,
bool
bWasSuccessful)
44
{
45
bIsRequest
=
false
;
46
47
if
(bWasSuccessful)
48
{
49
if
(
auto
PlayerActor =
ULingoGameHelper::GetPlayerActor
(
this
))
50
PlayerActor->PlayTTSAudio(ResponseData.
audio_base64
);
51
}
52
}
53
54
55
void
UPopup_SpeakQuest::OnClickOk
()
56
{
57
// PopupManager를 통해 팝업 닫기 (마우스 커서 처리 포함)
58
if
(
UPopupManager
* PopupMgr = UPopupManager::Get(GetWorld()))
59
{
60
PopupMgr->HideCurrentPopup();
61
}
62
63
if
(
OnOkDelegate
.IsBound())
64
OnOkDelegate
.Execute();
65
}
APlayerActor.h
Declares the player-controlled character actor.
UImageButton.h
UKLingoNetworkSystem.h
KLingo API 요청을 담당하는 서브시스템을 선언합니다.
ULingoGameHelper.h
UPopupManager.h
UPopup_SpeakQuest.h
ULingoGameHelper::GetPlayerActor
static class APlayerActor * GetPlayerActor(const UObject *WorldContextObject)
첫 번째 플레이어의 PlayerActor를 가져옵니다.
Definition
ULingoGameHelper.cpp:255
UPopupManager
팝업 관리자
Definition
UPopupManager.h:31
UPopup_SpeakQuest::OnOkDelegate
FOnMsgBoxOkDelegate OnOkDelegate
Definition
UPopup_SpeakQuest.h:32
UPopup_SpeakQuest::bIsRequest
bool bIsRequest
Definition
UPopup_SpeakQuest.h:34
UPopup_SpeakQuest::RequestListenAudio
void RequestListenAudio(const FString &AudioText)
Definition
UPopup_SpeakQuest.cpp:27
UPopup_SpeakQuest::InitPopup
void InitPopup(const FOnMsgBoxOkDelegate &InOkDelegate)
Definition
UPopup_SpeakQuest.cpp:12
UPopup_SpeakQuest::OnResponseListenAudio
void OnResponseListenAudio(FResponseListenAudio &ResponseListenAudio, bool bArg)
Definition
UPopup_SpeakQuest.cpp:43
UPopup_SpeakQuest::OnClickOk
void OnClickOk()
Definition
UPopup_SpeakQuest.cpp:55
UPopup_SpeakQuest::Btn_Ok
TObjectPtr< class UImageButton > Btn_Ok
Definition
UPopup_SpeakQuest.h:29
FResponseListenAudio
Definition
NetworkData.h:800
FResponseListenAudio::audio_base64
TArray< uint8 > audio_base64
Definition
NetworkData.h:807
Source
Onepiece
MessageBox
Private
UPopup_SpeakQuest.cpp
생성시간 : 금 1월 9 2026 00:25:57, 프로젝트명 : KLingo Project Documentation, 생성자 :
1.9.8