//constructor public bus_mod() { Interval = 0; UI.Notify("Bus mod loaded - scorz"); menu_p = new MenuPool(); Tick += (o, e) => { menu_p.ProcessMenus(); if (_lock) { _mis._check(); }; if (__lock) { _mr.check(); }; }; KeyDown += (o, e) => { if (e.KeyCode.ToString() == keycode.ToString() && !menu_p.IsAnyMenuOpen()) this.main_menu(); }; }
public MenuExample() { _menuPool = new MenuPool(); var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE"); _menuPool.Add(mainMenu); AddMenuKetchup(mainMenu); AddMenuFoods(mainMenu); AddMenuCook(mainMenu); AddMenuAnotherMenu(mainMenu); _menuPool.RefreshIndex(); Tick += (o, e) => _menuPool.ProcessMenus(); KeyDown += (o, e) => { if (e.KeyCode == Keys.F5 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch mainMenu.Visible = !mainMenu.Visible; }; }