AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [FIXED in future AMXX versions] New menu natives - Padding "exit" to 0 (https://forums.alliedmods.net/showthread.php?t=49118)

-mE- 12-28-2006 09:31

[FIXED in future AMXX versions] New menu natives - Padding "exit" to 0
 
I'm trying to create menus using the new menu natives and pad "exit" to 0, no matter how many items there are.

After trying all possible combinations of menu_setprops and studying the includes I wonder if there's even a way to force back/forward/exit to use slot 8/9/0.

According to the includes it would assume the following code should work
Code:

public show(id){
  new menu = menu_create("Test","handler")
  menu_additem(menu,"First")
  menu_additem(menu,"Second")
  // variable number of items here

  menu_setprop(menu,MPROP_PERPAGE,7) // make sure we have a maximum of 7 items per page (default anyway)
  menu_setprop(menu,MRROP_EXIT,MEXIT_ALL) // always display "exit"
  menu_setprop(menu,MPROP_PADMENU,MENUPAD_PAGE) // pad special items to end of the page

  menu_display(id,menu,0)
}

Should look like this:
Quote:

Test
1. First
2. Second

0. Exit
Actually looks like this:
Quote:

Test
1. First
2. Second

7. Exit
Looks like I'd have to force 10 items per page, but menu_setprop(menu,MPROP_PERPAGE,...) throws a native error if supplied with anything bigger than 7.

Thanks in advance.
(And no, using old style menus is not an option)

Brad 12-28-2006 12:20

Re: New menu natives - Padding "exit" to 0
 
You can pad your menus with blanks to force all but the last page to use 0 as exit.

Hopefully this will be addressed in a future release of AMXX. I've already filed a report regarding it. http://forums.alliedmods.net/showthread.php?t=48744


All times are GMT -4. The time now is 22:24.

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