update code hide popup before

This commit is contained in:
CuongNV
2026-04-20 14:37:28 +07:00
parent 6f81209da6
commit d30a3d5e99
@@ -14,6 +14,8 @@ namespace BrewMonster.Scripts.ChatUI
{
[Header("MiniChat")]
public Button onOpenChatPanelButton;
[Tooltip("Dialog name registered in CECUIManager/CECGameUIMan for full chat panel.")]
[SerializeField] string chatDialogName = "Win_Chat";
[Tooltip("Parent cho các dòng tin xem trước (nên có VerticalLayoutGroup).")]
public RectTransform miniChatContent;
[Tooltip("ScrollRect bọc mini chat (null = không cuộn). Nếu để trống, Awake sẽ thử GetComponentInParent từ miniChatContent.")]
@@ -78,6 +80,10 @@ namespace BrewMonster.Scripts.ChatUI
void OnOpenChatPanelButtonClicked()
{
// Open through CECUIManager stack so current top UI/popup is hidden consistently.
if (!string.IsNullOrEmpty(chatDialogName) && CECUIManager.Instance != null)
CECUIManager.Instance.ShowUI(chatDialogName);
EventBus.Publish(new OpenChatPanelRequestedEvent());
}