Fix unasign event on npc dlg

This commit is contained in:
HungDK
2026-04-09 16:14:01 +07:00
parent d80cb167b5
commit 05dec39638
2 changed files with 21 additions and 13 deletions
@@ -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
{
@@ -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)