Skip to content

MenuPool (deprecated see MenuHandler)

Leonardo Emanuele edited this page Aug 5, 2023 · 2 revisions

MenuPool


MenuPool is only use in releases before The Gary release v4

In The Gary v4 the MenuPool is no longer required and was removed, menus can now be made visible when you require them, please refer to the latest examples.


MenuPool is the main container.. everything you do is inside this.
Each menu and pause menu is contained here, it handles the menu processes and can handle the menus. Let's see the main functions of this container!

First of all it must be instantiated in every script you have one or more menus. so at the beginning of your script you'll write:
C#:

public MenuPool MenuPool = new MenuPool();

Lua:

MenuPool = MenuPool.New()

MenuPool can be used for these functions:
C#:

Add(UIMenu menu)
Add(TabView pauseMenu)
AddSubMenu(UIMenu menu, string text)
AddSubMenu(UIMenu menu, string text, PointF offset)
AddSubMenu(UIMenu menu, string text, string description) // the most used as usually all submenus inherit the parentMenu properties.
AddSubMenu(UIMenu menu, string text, string description, PointF offset)
ProcessMenus()
CloseAllMenus()
bool IsAnyMenuOpen
bool IsAnyPauseMenuOpen

Lua:

:AddSubMenu(Menu, Text, Description, KeepPosition, KeepBanner)
:Add(Menu)
:AddPauseMenu(Menu)
:ProcessControl()
:Draw()
:CloseAllMenus()
:IsAnyMenuOpen() // return bool
:IsAnyPauseMenuOpen() // return bool
Clone this wiki locally