AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Custom Admin Menu (https://forums.alliedmods.net/showthread.php?t=106411)

Bigbuck 10-14-2009 20:58

Custom Admin Menu
 
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.

XARIUS 10-14-2009 21:14

Re: Custom Admin Menu
 
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

Bigbuck 10-14-2009 21:39

Re: Custom Admin Menu
 
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.

XARIUS 10-14-2009 21:42

Re: Custom Admin Menu
 
Quote:

Originally Posted by Bigbuck (Post 962317)
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.

Bigbuck 10-22-2009 15:44

Re: Custom Admin Menu
 
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.

XARIUS 10-22-2009 21:09

Re: Custom Admin Menu
 
Quote:

Originally Posted by Bigbuck (Post 969380)
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


All times are GMT -4. The time now is 11:50.

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