View Single Post
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 07-22-2006 , 10:09   Re: Counter Strike Bot Control
Reply With Quote #21

@Roger Devil
When does this problem happen?
If it happens in this order:
Someone opens BOT menu, then opens the clan menu without closing the BOT menu there is nothing that can be done with this without adding a extra callback to the AdminInterface ( That i can think of). Atm there is no way for a plugin to know when another plugin has opend a menu ontop of another menu.
So admins need to close the menu in 1 plugin before opening it in the next

You have to add a check if BotControl has a menu opened, otherwise ignore the menuselect-command to give the other plugin the possiblity to react.

I do if you look right above that code:
Quote:
if(g_HasMenuOpen[id] == false) <-- This being the magic line that checks if the user has a menu open
RETURN_META(MRES_IGNORED);
if (strcmp(command,"menuselect") == 0)
{
char *arg1 = m_Engine->Cmd_Argv(1);
//catch menu commands

if (arg1)
{
int arg = atoi(arg1);
if(arg < 1 || arg > 10) // Make sure makes no invalid selection.

return;
g_MenuMngr.MenuChoice(id, arg);
RETURN_META(MRES_SUPERCEDE);
}
}

__________________
Github archive for plugins, the repos for the other c++ projects are there to.
EKS is offline