CS2D
Scripts
Close menu
Close menu
3 replies How to close menu opened with Lua function menu(id, str)? You can't close it.
Possible workarounds:
You can show an invisible menu using the @i suffix, good in theory, bad in practice, nobody knows this feature exists and it doesn't actually close the menu, just replaces it with an empty invisible menu.
Create an empty menu to replace the old menu, doesn't close it, only prevents seeing the old content.
Create your own GUI for menus where you can show your own menu (
image) and then free the image (
freeimage) when you want to close the menu.
There could be other approaches you can take, but realistically it is not currently possible to close the menu, you can only hide it in various ways (whilst retaining a menu open) or create your own menu system. I need to close the menu, not hide, not create a custom.
I use the @i menu to hide the interface of items (at the top of the screen) when scrolling the mouse wheel. And in order to restore the normal process, I need to close the menu with the @i parameter. As I said, CS2D does not have a function permitting closing a menu as a server to the client.