AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu Question (https://forums.alliedmods.net/showthread.php?t=243204)

pob18 07-01-2014 07:11

Menu Question
 
How to delete the (back/next page) from a menu?

jimaway 07-01-2014 07:22

Re: Menu Question
 
#define MPROP_PERPAGE 1 /* Number of items per page (param1 = number, 0=no paginating, 7=default) */

setting it to 0 will also remove the exit option, if you still want it you have to re-create it

pob18 07-01-2014 10:10

Re: Menu Question
 
And how I re-create the exit function? (to 0) if MPROP_PERPAGE IS 0

jimaway 07-01-2014 16:16

Re: Menu Question
 
/**
* Adds a blank line to a menu.
*
* @param menu Menu resource identifier.
* @param slot 1 (default) if the line should shift the numbering down.
* 0 if the line should be a visual shift only.
* @noreturn
* @error Invalid menu resource.
*/
native menu_addblank(menu, slot=1);

pob18 07-01-2014 16:32

Re: Menu Question
 
What?

fysiks 07-01-2014 16:49

Re: Menu Question
 
Quote:

Originally Posted by pob18 (Post 2160494)
What?

Use that function to add blanks until you get to the zero key where you would add a item that says "Exit".

Backstabnoob 07-01-2014 19:04

Re: Menu Question
 
You cannot add two blanks in a row, it won't work. The whole menu_addblank native seems flawed and you should use ^n in the previous item for a newline instead.

Also, this is completely unnecessary. MPROP_PERPAGE doesn't remove the exit button and while the .inc file says it's deprecated, it really isn't. menu_setprop( menu, MPROP_PERPAGE, 0 ) positions the Exit button at slot 0 and also removes the previous/next items IIRC.

fysiks 07-01-2014 19:19

Re: Menu Question
 
Quote:

Originally Posted by Backstabnoob (Post 2160543)
Also, this is completely unnecessary. MPROP_PERPAGE doesn't remove the exit button and while the .inc file says it's deprecated, it really isn't. menu_setprop( menu, MPROP_PERPAGE, 0 ) positions the Exit button at slot 0 and also removes the previous/next items IIRC.

I thought the same thing but I wrote a test plugin to verify. The exit option is indeed removed.

Backstabnoob 07-01-2014 19:24

Re: Menu Question
 
Oh, that sucks. Wouldn't force showing it again with MPROP_EXIT work? It probably won't, but it's worth trying at least.

fysiks 07-01-2014 19:24

Re: Menu Question
 
The solution is to not put more than MPROP_PERPAGE items in the menu. If MPROP_PERPAGE is set to 3 and you have 3 menu items, there will be no paginating and thus no next/back options.


All times are GMT -4. The time now is 21:08.

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