Raised This Month: $51 Target: $400
 12% 

How can I remove menu item from !settings menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 04-20-2009 , 07:30   How can I remove menu item from !settings menu?
Reply With Quote #1

What I have to do into callback function if I want to remove menu item from !settings (clientprefs) menu?

PHP Code:
SetCookieMenuItem(MyButton0"Press me");

public 
MyButton(clientCookieMenuAction:actionany:infoString:buffer[], maxlen)
{
    if (
action == CookieMenuAction_DisplayOption)
    {
        
// some stuff
    
}
    else
    {
        
// some stuff
    
}

__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
BAILOPAN
Join Date: Jan 2004
Old 04-20-2009 , 08:04   Re: How can I remove menu item from !settings menu?
Reply With Quote #2

If you want it off the menu, why is it added in the first place?
__________________
egg
BAILOPAN is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 04-20-2009 , 08:14   Re: How can I remove menu item from !settings menu?
Reply With Quote #3

Sometimes server administrators may turn off some parts of functionality of my plugin and in this case some of the items in settings menu must be removed.
I know that I can add check when I am creating this menu item but it would be much better if I also could remove this item if server administrtor will turn off this part of functions of my plugin after plugin already created menu item.
__________________
For admins: My plugins

For developers: Colors library

Last edited by exvel; 04-20-2009 at 08:18.
exvel is offline
Send a message via ICQ to exvel
BAILOPAN
Join Date: Jan 2004
Old 04-22-2009 , 12:09   Re: How can I remove menu item from !settings menu?
Reply With Quote #4

Hrm. That sounds like a valid use case - I'd file a bug if such a function doesn't exist.
__________________
egg
BAILOPAN is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 04-22-2009 , 12:17   Re: How can I remove menu item from !settings menu?
Reply With Quote #5

Ok, I have posted it: http://bugs.alliedmods.net/show_bug.cgi?id=3794
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
XARIUS
SourceMod Donor
Join Date: May 2008
Location: Atlanta, GA
Old 10-12-2009 , 21:27   Re: How can I remove menu item from !settings menu?
Reply With Quote #6

Sorry for the age bump on this. Did a function such as RemoveCookiePrefabMenu or RemoveCookieMenuItem ever get added?

I find myself in the same situation, needing to dynamically add or remove clientprefs menu items based on whether certain parts of the plugin are active/enabled.

I feel it would be a worthy addition!

X
__________________

Last edited by XARIUS; 10-12-2009 at 21:34.
XARIUS is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode