topmenu callback now sets proper reply-to source

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401526
This commit is contained in:
David Anderson 2007-10-02 01:51:38 +00:00
parent c420f453de
commit afbfb98f1a
2 changed files with 6 additions and 2 deletions

View File

@ -38,8 +38,8 @@
*/
/* Basic information exposed publicly */
#define SMEXT_CONF_NAME "Main Menu"
#define SMEXT_CONF_DESCRIPTION "Manages SourceMod's main menus"
#define SMEXT_CONF_NAME "Top Menus"
#define SMEXT_CONF_DESCRIPTION "Creates sorted nested menus"
#define SMEXT_CONF_VERSION "1.0.0.0"
#define SMEXT_CONF_AUTHOR "AlliedModders"
#define SMEXT_CONF_URL "http://www.sourcemod.net/"

View File

@ -113,6 +113,7 @@ public:
int client,
unsigned int object_id)
{
unsigned int old_reply = playerhelpers->SetReplyTo(SM_REPLY_CHAT);
m_pFunction->PushCell(m_hMenuHandle);
m_pFunction->PushCell(TopMenuAction_SelectOption);
m_pFunction->PushCell(object_id);
@ -120,6 +121,7 @@ public:
m_pFunction->PushString("");
m_pFunction->PushCell(0);
m_pFunction->Execute(NULL);
playerhelpers->SetReplyTo(old_reply);
}
void OnTopMenuObjectRemoved(ITopMenu *menu, unsigned int object_id)
@ -226,6 +228,8 @@ static cell_t AddToTopMenu(IPluginContext *pContext, const cell_t *params)
return 0;
}
cb->m_hMenuHandle = params[1];
return object_id;
}