ProcessMenus() public method

Process all of your menus' functions. Call this in a tick event.
public ProcessMenus ( ) : void
return void
示例#1
0
        //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();

            };
        }
示例#2
0
    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;
        };
    }