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

Solved How to make menu with categories


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 02-03-2019 , 18:24   How to make menu with categories
Reply With Quote #1

Csgo.
So I want to do menu with categories, something similar to admin menu. The most important thing here for me is availability to return back to the main menu by pressing '7' (back)
Thanks in advance.

Last edited by impossible_cc; 02-05-2019 at 10:34.
impossible_cc is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 02-03-2019 , 19:18   Re: How to make menu with categories
Reply With Quote #2

Here's a Deathmatching menu I made for someone:
Spoiler
CliptonHeist is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-03-2019 , 23:10   Re: How to make menu with categories
Reply With Quote #3

@CliptonHeist Why would you manually add a Back button when the Menu API has the option to do it for you?

For reference, it's the menu's ExitBackButton property (new style) or SetMenuExitBackButton function (old style).

You can tell when a player selects it because it will trigger a MenuAction_Cancel with param2 set to MenuCancel_ExitBack
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-03-2019 at 23:13.
Powerlord is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 02-04-2019 , 01:29   Re: How to make menu with categories
Reply With Quote #4

Well I just got into the habit of doing that because I'd have other stuff being done when clients use the back button instead of just showing the menu, I realize it's not needed here but oh well.
CliptonHeist is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 02-04-2019 , 11:55   Re: How to make menu with categories
Reply With Quote #5

That's nice, I will try, thanks.

I don't want to create another topic for that. So can you also help me, how can I force menu to open on the certain page?
For example menu has a lot of items, so it has more then 1 page. After choosing any item I want to redisplay the same menu. The problem is that redisplayed menu is opened on the first page always.
I want to do - if player has choosen item from 3rd page, menu on 3rd page is redisplayed.

Thanks.
impossible_cc is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-04-2019 , 14:04   Re: How to make menu with categories
Reply With Quote #6

Quote:
Originally Posted by impossible_cc View Post
That's nice, I will try, thanks.

I don't want to create another topic for that. So can you also help me, how can I force menu to open on the certain page?
For example menu has a lot of items, so it has more then 1 page. After choosing any item I want to redisplay the same menu. The problem is that redisplayed menu is opened on the first page always.
I want to do - if player has choosen item from 3rd page, menu on 3rd page is redisplayed.

Thanks.
You can get the value of the menu.Selection property / GetMenuSelectionPosition in a MenuAction_Select handler and use it with menu.DisplayAt / DisplayMenuAtItem.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-04-2019 at 14:19. Reason: rephrased and added links
Powerlord is offline
Reply


Thread Tools
Display Modes

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 19:41.


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