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

MENU_EXIT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 11-19-2017 , 13:54   MENU_EXIT
Reply With Quote #1

Is MENU_EXIT guaranteed to get called when a menu is displayed to a client?

1. A game menu or another menu by a plugin overrides it.
2. A player's hud resets.
3. A player disconnects.
4. Map changes while the player is viewing a menu.
5. Any other scenario? Can I expect MENU_EXIT to always get called?
PartialCloning is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-19-2017 , 14:24   Re: MENU_EXIT
Reply With Quote #2

~) Client exited the menu.
~) Menu timeout.
~) After client choosed its option and menu exited.
~) Motd(not sure)
__________________
Relaxing is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-19-2017 , 19:53   Re: MENU_EXIT
Reply With Quote #3

Quote:
Originally Posted by PartialCloning View Post
Is MENU_EXIT guaranteed to get called when a menu is displayed to a client?
I think yes, because I've seen that in every code, they check
Code:
if( iItem == MENU_EXIT )
without using menu_setprop.
__________________

Last edited by edon1337; 11-19-2017 at 19:54.
edon1337 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 11-20-2017 , 02:02   Re: MENU_EXIT
Reply With Quote #4

You can test, put down some text when item is Menu exit
if(item==MENU_EXIT)
client_print.....
And just toggle some other menu and see what happens with the current one.
siriusmd99 is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 11-20-2017 , 04:38   Re: MENU_EXIT
Reply With Quote #5

I think you misunderstood the question. I can't test if MENU_EXIT is guaranteed to be called at every possible scenario as some are hard to replicate.

The points I listed are examples to clarify the question. What I would like to know is if amxx takes into account every possible case and calls MENU_EXIT when a menu is displayed and no option is selected. If not does that result in leaks or does amxx internally destroy the handles without calling MENU_EXIT in the menu handler.
PartialCloning is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-20-2017 , 10:16   Re: MENU_EXIT
Reply With Quote #6

Quote:
Originally Posted by PartialCloning View Post
I think you misunderstood the question...
If MENU_EXIT isn't same as menu_destroy(), then MENU_EXIT will be called only on value output(key trigger)
menu_destroy() forces the menu to remove, in this case all other possibilities.(disconnection, plugin's override...)
__________________
Relaxing is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 11-20-2017 , 12:58   Re: MENU_EXIT
Reply With Quote #7

Even in the unlikely case that it covers some of that list besides when you actually press a button, I wouldn't think it would especially in an instant map change, consider crashes too
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 11-20-2017 , 16:31   Re: MENU_EXIT
Reply With Quote #8

Quote:
Originally Posted by Relaxing View Post
If MENU_EXIT isn't same as menu_destroy(), then MENU_EXIT will be called only on value output(key trigger)
menu_destroy() forces the menu to remove, in this case all other possibilities.(disconnection, plugin's override...)
MENU_EXIT is called when you override a menu with another. How are you sure it's called in all other cases?

Quote:
Originally Posted by aron9forever View Post
Even in the unlikely case that it covers some of that list besides when you actually press a button, I wouldn't think it would especially in an instant map change, consider crashes too
It does work after an instant map change, if by instant you mean typing map de_dust2 in console. Crashes don't matter, if a server crashes I don't expect plugin_end to be called either.

"client_disconnected is guaranteed to pair with the client_connect()". if one is called so will the other. What I would like to know is if there exists such a connection between menu_display and MENU_EXIT being called in the menu handler function.
PartialCloning is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 11-21-2017 , 02:19   Re: MENU_EXIT
Reply With Quote #9

I think you can only find this in the amxx source wherever newmenus are handled
I'll try having a look as well when I have the time

literally testing for all scenarios might be quicker so I understand why you are looking for someone who can tell you without checking
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever 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 09:47.


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