KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UPopupManager.h
이 파일의 문서화 페이지로 가기
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#pragma once
4
5#include "CoreMinimal.h"
6#include "EPopupType.h"
7#include "Macro.h"
8#include "Subsystems/LocalPlayerSubsystem.h"
9#include "UPopupManager.generated.h"
10
29UCLASS()
30class ONEPIECE_API UPopupManager : public ULocalPlayerSubsystem
31{
32 GENERATED_BODY()
33
34public:
36
38
39public:
40 // ========================================
41 // 팝업 클래스 설정
42 // ========================================
43
45 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Popup|Setup")
46 TMap<EPopupType, TSubclassOf<UUserWidget>> PopupClassMap;
47
48private:
49 // ========================================
50 // 팝업 인스턴스 관리
51 // ========================================
52
54 UPROPERTY()
55 TMap<EPopupType, UUserWidget*> PopupWidgetMap;
56
58 UPROPERTY()
59 TArray<EPopupType> PopupStack;
60
61public:
62 // ========================================
63 // 범용 팝업 관리 함수
64 // ========================================
65
71 UFUNCTION(BlueprintCallable, Category = "Popup")
72 UUserWidget* ShowPopup(EPopupType Type);
73
88 template<typename T>
89 T* ShowPopupAs(EPopupType Type)
90 {
91 return Cast<T>(ShowPopup(Type));
92 }
93
109 template<typename T>
110 static T* ShowPopupAs(UWorld* World, EPopupType Type)
111 {
112 if (UPopupManager* Mgr = Get(World))
113 {
114 return Mgr->ShowPopupAs<T>(Type);
115 }
116 return nullptr;
117 }
118
124 UFUNCTION(BlueprintCallable, Category = "Popup")
125 void HidePopup(EPopupType Type, bool bDestroyWidget = false);
126
131 UFUNCTION(BlueprintCallable, Category = "Popup")
132 void HideCurrentPopup(bool bDestroyWidget = false);
133
138 UFUNCTION(BlueprintCallable, Category = "Popup")
139 void HideAllPopups(bool bDestroyWidgets = false);
140
141 // ========================================
142 // 팝업 쿼리 함수
143 // ========================================
144
150 UFUNCTION(BlueprintCallable, Category = "Popup")
151 bool GetCurrentPopupType(EPopupType& OutType) const;
152
157 UFUNCTION(BlueprintCallable, Category = "Popup")
158 UUserWidget* GetCurrentPopupWidget() const;
159
165 UFUNCTION(BlueprintCallable, Category = "Popup")
166 UUserWidget* GetPopupWidget(EPopupType Type) const;
167
173 UFUNCTION(BlueprintCallable, Category = "Popup")
174 bool IsPopupInStack(EPopupType Type) const;
175
180 UFUNCTION(BlueprintCallable, Category = "Popup")
181 int32 GetPopupStackCount() const;
182
188 UFUNCTION(BlueprintCallable, Category = "Popup")
189 bool ShouldBlockPlayerControl() const;
190
191 // ========================================
192 // 메시지 박스 전용 함수 (편의 함수)
193 // ========================================
194
202 void ShowMsgBox(
203 const FString& InTitle,
204 const FString& InDescription,
205 EMsgBoxType InType,
206 const FOnMsgBoxOkDelegate& InOkDelegate);
207
216 void ShowMsgBox(
217 const FString& InTitle,
218 const FString& InDescription,
219 EMsgBoxType InType,
220 const FOnMsgBoxOkDelegate& InOkDelegate,
221 const FOnMsgBoxCancelDelegate& InCancelDelegate);
222
230 UFUNCTION(BlueprintCallable, Category = "Popup|MessageBox")
231 void ShowMsgBoxSimple(
232 const FString& InTitle,
233 const FString& InDescription,
234 EMsgBoxType InType);
235
236protected:
237 // ========================================
238 // 내부 헬퍼 함수
239 // ========================================
240
246 UUserWidget* EnsurePopupWidget(EPopupType Type);
247
252 void PushPopupToStack(EPopupType Type);
253
258 void RemovePopupFromStack(EPopupType Type);
259};
@ Get
HTTP GET 요청을 나타냅니다.
EMsgBoxType
Definition EPopupType.h:49
EPopupType
팝업 타입 정의
Definition EPopupType.h:14
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
팝업 관리자
DEFINE_LOCALPLAYER_SUBSYSTEM_GETTER_INLINE(UPopupManager)
static T * ShowPopupAs(UWorld *World, EPopupType Type)
타입 캐스팅된 팝업 표시 (Static 헬퍼)