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:
parent
c420f453de
commit
afbfb98f1a
@ -38,8 +38,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Basic information exposed publicly */
|
/* Basic information exposed publicly */
|
||||||
#define SMEXT_CONF_NAME "Main Menu"
|
#define SMEXT_CONF_NAME "Top Menus"
|
||||||
#define SMEXT_CONF_DESCRIPTION "Manages SourceMod's main menus"
|
#define SMEXT_CONF_DESCRIPTION "Creates sorted nested menus"
|
||||||
#define SMEXT_CONF_VERSION "1.0.0.0"
|
#define SMEXT_CONF_VERSION "1.0.0.0"
|
||||||
#define SMEXT_CONF_AUTHOR "AlliedModders"
|
#define SMEXT_CONF_AUTHOR "AlliedModders"
|
||||||
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
|
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
|
||||||
|
@ -113,6 +113,7 @@ public:
|
|||||||
int client,
|
int client,
|
||||||
unsigned int object_id)
|
unsigned int object_id)
|
||||||
{
|
{
|
||||||
|
unsigned int old_reply = playerhelpers->SetReplyTo(SM_REPLY_CHAT);
|
||||||
m_pFunction->PushCell(m_hMenuHandle);
|
m_pFunction->PushCell(m_hMenuHandle);
|
||||||
m_pFunction->PushCell(TopMenuAction_SelectOption);
|
m_pFunction->PushCell(TopMenuAction_SelectOption);
|
||||||
m_pFunction->PushCell(object_id);
|
m_pFunction->PushCell(object_id);
|
||||||
@ -120,6 +121,7 @@ public:
|
|||||||
m_pFunction->PushString("");
|
m_pFunction->PushString("");
|
||||||
m_pFunction->PushCell(0);
|
m_pFunction->PushCell(0);
|
||||||
m_pFunction->Execute(NULL);
|
m_pFunction->Execute(NULL);
|
||||||
|
playerhelpers->SetReplyTo(old_reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTopMenuObjectRemoved(ITopMenu *menu, unsigned int object_id)
|
void OnTopMenuObjectRemoved(ITopMenu *menu, unsigned int object_id)
|
||||||
@ -226,6 +228,8 @@ static cell_t AddToTopMenu(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cb->m_hMenuHandle = params[1];
|
||||||
|
|
||||||
return object_id;
|
return object_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user