From afbfb98f1a5a152cfd9492749fb1631c1468768a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Oct 2007 01:51:38 +0000 Subject: [PATCH] topmenu callback now sets proper reply-to source --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401526 --- extensions/topmenus/sdk/smsdk_config.h | 4 ++-- extensions/topmenus/smn_topmenus.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/topmenus/sdk/smsdk_config.h b/extensions/topmenus/sdk/smsdk_config.h index 847cdcf2..8b97b88d 100644 --- a/extensions/topmenus/sdk/smsdk_config.h +++ b/extensions/topmenus/sdk/smsdk_config.h @@ -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/" diff --git a/extensions/topmenus/smn_topmenus.cpp b/extensions/topmenus/smn_topmenus.cpp index 74bb06f4..e9ecc39a 100644 --- a/extensions/topmenus/smn_topmenus.cpp +++ b/extensions/topmenus/smn_topmenus.cpp @@ -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; }