51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using BlueWater.Uis;
|
|
|
|
namespace BlueWater
|
|
{
|
|
public static class PopupUiController
|
|
{
|
|
public static List<PopupUi> PopupUis { get; private set; } = new();
|
|
|
|
// Popup 등록
|
|
public static void RegisterPopup(PopupUi popup)
|
|
{
|
|
if (!PopupUis.Contains(popup))
|
|
{
|
|
PopupUis.Add(popup);
|
|
}
|
|
}
|
|
|
|
// Popup 해제
|
|
public static void UnregisterPopup(PopupUi popup)
|
|
{
|
|
if (PopupUis.Contains(popup))
|
|
{
|
|
PopupUis.Remove(popup);
|
|
}
|
|
}
|
|
|
|
// 마지막 Popup 닫기
|
|
public static void CloseLastPopup()
|
|
{
|
|
if (PopupUis.Count <= 0) return;
|
|
|
|
PopupUis[^1].Close();
|
|
}
|
|
|
|
// 모든 Popup 닫기
|
|
public static void CloseAllPopup()
|
|
{
|
|
foreach (var element in PopupUis)
|
|
{
|
|
if (!element.IsOpened) continue;
|
|
|
|
element.Close();
|
|
}
|
|
}
|
|
|
|
// Popup 목록이 비어 있는지 확인
|
|
public static bool IsPopupListEmpty() => PopupUis.Count == 0;
|
|
}
|
|
}
|