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
This commit is contained in:
David Anderson 2007-10-02 14:06:07 +00:00
parent 9c1807bd31
commit 7cb4d7ae9c

View File

@ -42,6 +42,7 @@
#if defined MENU_DEBUG #if defined MENU_DEBUG
#include "Logger.h" #include "Logger.h"
#endif #endif
#include "ChatTriggers.h"
#if defined CreateMenu #if defined CreateMenu
#undef CreateMenu #undef CreateMenu
@ -261,11 +262,13 @@ void CPanelHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int item)
{ {
if (m_pFunc) if (m_pFunc)
{ {
unsigned int old_reply = g_ChatTriggers.SetReplyTo(SM_REPLY_CHAT);
m_pFunc->PushCell(BAD_HANDLE); m_pFunc->PushCell(BAD_HANDLE);
m_pFunc->PushCell(MenuAction_Select); m_pFunc->PushCell(MenuAction_Select);
m_pFunc->PushCell(client); m_pFunc->PushCell(client);
m_pFunc->PushCell(item); m_pFunc->PushCell(item);
m_pFunc->Execute(NULL); m_pFunc->Execute(NULL);
g_ChatTriggers.SetReplyTo(old_reply);
} }
g_MenuHelpers.FreePanelHandler(this); g_MenuHelpers.FreePanelHandler(this);
} }
@ -320,14 +323,18 @@ void CMenuHandler::OnMenuSelect2(IBaseMenu *menu, int client, unsigned int item,
s_CurSelectPosition = &first_item; s_CurSelectPosition = &first_item;
unsigned int old_reply = g_ChatTriggers.SetReplyTo(SM_REPLY_CHAT);
DoAction(menu, MenuAction_Select, client, item); DoAction(menu, MenuAction_Select, client, item);
g_ChatTriggers.SetReplyTo(old_reply);
s_CurSelectPosition = old_pos; s_CurSelectPosition = old_pos;
} }
void CMenuHandler::OnMenuCancel(IBaseMenu *menu, int client, MenuCancelReason reason) 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); DoAction(menu, MenuAction_Cancel, client, (cell_t)reason);
g_ChatTriggers.SetReplyTo(old_reply);
} }
void CMenuHandler::OnMenuEnd(IBaseMenu *menu, MenuEndReason reason) void CMenuHandler::OnMenuEnd(IBaseMenu *menu, MenuEndReason reason)