From 7cb4d7ae9cad22649bacb74f026dc1e10b30f159 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Oct 2007 14:06:07 +0000 Subject: [PATCH] menuaction_select and menuaction_cancel now set the reply source to SM_REPLY_CHAT --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401528 --- core/smn_menus.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/smn_menus.cpp b/core/smn_menus.cpp index 358d8b36..4074c8df 100644 --- a/core/smn_menus.cpp +++ b/core/smn_menus.cpp @@ -42,6 +42,7 @@ #if defined MENU_DEBUG #include "Logger.h" #endif +#include "ChatTriggers.h" #if defined CreateMenu #undef CreateMenu @@ -261,11 +262,13 @@ void CPanelHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int item) { if (m_pFunc) { + unsigned int old_reply = g_ChatTriggers.SetReplyTo(SM_REPLY_CHAT); m_pFunc->PushCell(BAD_HANDLE); m_pFunc->PushCell(MenuAction_Select); m_pFunc->PushCell(client); m_pFunc->PushCell(item); m_pFunc->Execute(NULL); + g_ChatTriggers.SetReplyTo(old_reply); } g_MenuHelpers.FreePanelHandler(this); } @@ -320,14 +323,18 @@ void CMenuHandler::OnMenuSelect2(IBaseMenu *menu, int client, unsigned int item, s_CurSelectPosition = &first_item; + unsigned int old_reply = g_ChatTriggers.SetReplyTo(SM_REPLY_CHAT); DoAction(menu, MenuAction_Select, client, item); + g_ChatTriggers.SetReplyTo(old_reply); s_CurSelectPosition = old_pos; } void CMenuHandler::OnMenuCancel(IBaseMenu *menu, int client, MenuCancelReason reason) { + unsigned int old_reply = g_ChatTriggers.SetReplyTo(SM_REPLY_CHAT); DoAction(menu, MenuAction_Cancel, client, (cell_t)reason); + g_ChatTriggers.SetReplyTo(old_reply); } void CMenuHandler::OnMenuEnd(IBaseMenu *menu, MenuEndReason reason)