From 05dec39638202f550c8bc4c7bf9bdce830ab53b9 Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Thu, 9 Apr 2026 16:14:01 +0700 Subject: [PATCH] Fix unasign event on npc dlg --- .../Scripts/Managers/EC_HPWorkMove.cs | 18 +++++++++--------- .../PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs index 1603aad83f..20f29cd05c 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs @@ -1346,15 +1346,15 @@ namespace BrewMonster.Scripts // 显示弹窗通知玩家无法找到路径 if (CECUIManager.Instance != null) { - string message = $"Cannot find path to target position.\nPlease move manually to target location.\n\nMap Coordinates: ({mapX}, {mapZ}, ↑{mapY})"; - string messageCN = $"无法找到到目标位置的路径。\n请手动移动到目标位置。\n\n地图坐标: ({mapX}, {mapZ}, ↑{mapY})"; - - // CECUIManager.Instance.ShowMessageBox( - // "Path Not Found", // 路径未找到 - // message, // English message with map coordinates - // BrewMonster.MessageBoxType.YesButton - // ); - CECUIManager.Instance.ShowMessageBoxYes("Path Not Found", message, null, null); + // string message = $"Cannot find path to target position.\nPlease move manually to target location.\n\nMap Coordinates: ({mapX}, {mapZ}, ↑{mapY})"; + // string messageCN = $"无法找到到目标位置的路径。\n请手动移动到目标位置。\n\n地图坐标: ({mapX}, {mapZ}, ↑{mapY})"; + // + // // CECUIManager.Instance.ShowMessageBox( + // // "Path Not Found", // 路径未找到 + // // message, // English message with map coordinates + // // BrewMonster.MessageBoxType.YesButton + // // ); + // CECUIManager.Instance.ShowMessageBoxYes("Path Not Found", message, null, null); } else { diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs index 4c2083490f..823e9f0831 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs @@ -2138,7 +2138,6 @@ namespace BrewMonster.UI //GetGameUIMan().MessageBox("", pTask.FormatTaskTalk(pTalk.windows[i].talk_text), // MB_OK, A3DCOLORRGBA(255, 255, 255, 160)); GetGameUIMan().EndNPCService(); - //CloseDialogue(); break; } @@ -2146,10 +2145,11 @@ namespace BrewMonster.UI } else if (CECGameUIMan.TALKPROC_IS_FUNCTION(id)) // Function. { - if (GetGameUIMan().m_pCurNPCEssence != null) + if (GetGameUIMan(). m_pCurNPCEssence != null) { NPC_ESSENCE pEssence = GetGameUIMan().m_pCurNPCEssence.Value; int nIndex1 = (int)CECGameUIMan.TALKPROC_GET_FUNCTION_ID(id); + int idFunction = nIndex1; uint[] a_uiService = { pEssence.id_talk_service, // ½»Ì¸µÄ·þÎñID @@ -2176,15 +2176,16 @@ namespace BrewMonster.UI }; //TO DO: fix later // This show popup service NPC - PopupCorrespondingServiceDialog((int)id, + PopupCorrespondingServiceDialog(idFunction, (int)a_uiService[nIndex1], m_pLst_Main.GetItemDataPtr(nCurSel, 0, "")); } else { + int idFunction = (int)CECGameUIMan.TALKPROC_GET_FUNCTION_ID(id); //TO DO: fix later // This show popup service NPC PopupCorrespondingServiceDialog( - (int)id, 0, m_pLst_Main.GetItemDataPtr(nCurSel, 0, "")); + idFunction, 0, m_pLst_Main.GetItemDataPtr(nCurSel, 0, "")); } } else // Window. @@ -3932,6 +3933,13 @@ namespace BrewMonster.UI base.Awake(); m_btnBack.onClick.AddListener(()=> { OnCommand_back("back"); }); m_btnClose.onClick.AddListener(()=> { OnCommand_CANCEL("cancel"); }); + + // Ensure list items always have a click callback (task-finish dialogs may call PopupNPCDialog(talk_proc) + // without going through PopupNPCDialog(NPC_ESSENCE), which previously was the only place wiring this). + if (m_pLst_Main != null) + { + m_pLst_Main.SetActionOnClickBtnItem((int value) => { SelectListItem(value); }); + } } void PopupStorageTaskDialog(NPC_TASK_OUT_SERVICE pService, bool bTaskNPC)