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

Custom Admin Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bigbuck
Senior Member
Join Date: Jul 2009
Old 10-14-2009 , 20:58   Custom Admin Menu
Reply With Quote #1

Instead of having my admin menu in the plugin itself, I was thinking of putting it in a text file inside the sourcemod/configs directory. Is there a way I can do this without using the adminmenu_custom.txt? I would like to use my own text file just in case users already have a custom menu. I know I could edit the dynamicmenu.sp file to parse my file, but I would rather not start editing core SM files.
Bigbuck is offline
XARIUS
SourceMod Donor
Join Date: May 2008
Location: Atlanta, GA
Old 10-14-2009 , 21:14   Re: Custom Admin Menu
Reply With Quote #2

Yes! I just did this, actually.

See the following post, admin files and source included. Feel free to borrow pieces.

http://forums.alliedmods.net/showthread.php?t=106087

It was my first attempt at it, so there may be some areas which are redundant. I hope to clean it up more as it sinks in. I'm pretty sure I didn't use the keyvalue navigation functions properly, but I got it working. =)

X
__________________

Last edited by XARIUS; 10-14-2009 at 21:17.
XARIUS is offline
Bigbuck
Senior Member
Join Date: Jul 2009
Old 10-14-2009 , 21:39   Re: Custom Admin Menu
Reply With Quote #3

Yikes, that seems more difficult than just having it in the plugin . I was hoping that it was possible to be able to remove everything from the sp file and put it in the txt file, but I should have known better.
Bigbuck is offline
XARIUS
SourceMod Donor
Join Date: May 2008
Location: Atlanta, GA
Old 10-14-2009 , 21:42   Re: Custom Admin Menu
Reply With Quote #4

Quote:
Originally Posted by Bigbuck View Post
Yikes, that seems more difficult than just having it in the plugin . I was hoping that it was possible to be able to remove everything from the sp file and put it in the txt file, but I should have known better.
It was a bit of a pita, yes. But once you get the method down, it's simple to just loop thru a keyvalue file and insert the admin commands into your menu.
__________________
XARIUS is offline
Bigbuck
Senior Member
Join Date: Jul 2009
Old 10-22-2009 , 15:44   Re: Custom Admin Menu
Reply With Quote #5

One thing I did notice about your plugin, but forgot to ask before, was you mention you cannot add sub menus? Does this mean you cannot have something like show below?

PHP Code:
Zombe Havoc Top Menu
    Map Changer
        Coop
            No Mercy
        Versus
        Survival
    Auto Havoc
        Enable
        Disable 
My menu will be pretty nested once it is complete and I wanted to clarify it is was even possible to do this with your method before I start.

Last edited by Bigbuck; 10-22-2009 at 15:52.
Bigbuck is offline
XARIUS
SourceMod Donor
Join Date: May 2008
Location: Atlanta, GA
Old 10-22-2009 , 21:09   Re: Custom Admin Menu
Reply With Quote #6

Quote:
Originally Posted by Bigbuck View Post
One thing I did notice about your plugin, but forgot to ask before, was you mention you cannot add sub menus? Does this mean you cannot have something like show below?

PHP Code:
Zombe Havoc Top Menu
    Map Changer
        Coop
            No Mercy
        Versus
        Survival
    Auto Havoc
        Enable
        Disable 
My menu will be pretty nested once it is complete and I wanted to clarify it is was even possible to do this with your method before I start.
I was unable (using the admin menu) to create a subcategory within a subcategory. The Wiki seems to state the same thing quite clearly:

Quote:
The menu is organized into categories and items. Categories are top-level selections on the menu. Items are selectable entries inside categories. There are two important rules:
  • There is no nesting. Categories cannot have sub-categories.
  • Only categories can exist at the top level (i.e. items must have a parent category).
Whether this is also true for custom built menus, I am not sure, but would assume so.

Additionally, my method of sorting the items in my custom menus is null and void. Issuing LoadTopMenuConfig and specifying my own sorting file causes the other sourcemod admin menu entries to get sorted a-z by default, thus ignoring the original adminmenu_sorting.txt file entries. In hindsight, I suppose I should have seen this coming. I'm still searching for a way of sorting my custom category items without the end user having to copy/paste stuff into the adminmenu_sorting.txt files manually.

X
__________________

Last edited by XARIUS; 10-22-2009 at 21:13.
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 12:23.


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