How to hook menu display events
I want to destroy the previous menu when the player opens any other menu.
Therefore, I think "menu display event" or "menu hidden event" or "menu overwritten event" is needed. But I didn't find any key words related to this. Do you have any good ideas? |
Re: How to hook menu display events
Quote:
Quote:
|
Re: How to hook menu display events
Assuming you want to hook amxx menus as well, the above suggestion will not work alone.
What you can do is combine that with orpheu. Hook amxx show_menu, Menu:: Display and Menu::Close, there is no alternative. If you need that for VGUI menus it's hacky. You'll have to hook the message VGUIMenu, dispatch a Close Event on the current menu and Display Event on the menu that is being displayed. There may be an alternative but you will have to explain what you are trying to do and why you need that. |
Re: How to hook menu display events
Quote:
|
Re: How to hook menu display events
If you're referring to radio1-3 these don't create handlers that must be freed as they use the "old menu" style.
Only the ones created with menu_create must be freed, all you really need is to destroy them on their callback. If the player is currently viewing a menu created with menu_create and open another menu or diconnect, amxx does automatically call MENU_EXIT. Here's a simple plugin for testing. Code:
#include <amxmodx> To be honest newmenus should be completly reworked or at least have an option to remove items as with cellarray and celltrie, so instead of creating a new handler every time you open a menu, you would create it one time on plugin_init for example as you do with most things in amxx |
All times are GMT -4. The time now is 20:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.