Exemple #1
0
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
                SinglePlayerMenu.Show(Host);
                break;

            case KeysDef.K_ENTER:
                CurrentMenu.Hide( );
                Host.Commands.Buffer.Append(String.Format("save s{0}\n", _Cursor));
                return;

            case KeysDef.K_UPARROW:
            case KeysDef.K_LEFTARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor--;
                if (_Cursor < 0)
                {
                    _Cursor = MAX_SAVEGAMES - 1;
                }
                break;

            case KeysDef.K_DOWNARROW:
            case KeysDef.K_RIGHTARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor++;
                if (_Cursor >= MAX_SAVEGAMES)
                {
                    _Cursor = 0;
                }
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// M_Main_Key
        /// </summary>
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
                //Host.Keyboard.Destination = keydest_t.key_game;
                CurrentMenu.Hide( );
                Host.Client.cls.demonum = _SaveDemoNum;
                if (Host.Client.cls.demonum != -1 && !Host.Client.cls.demoplayback && Host.Client.cls.state != cactive_t.ca_connected)
                {
                    Host.Client.NextDemo( );
                }
                break;

            case KeysDef.K_DOWNARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                if (++_Cursor >= MAIN_ITEMS)
                {
                    _Cursor = 0;
                }
                break;

            case KeysDef.K_UPARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                if (--_Cursor < 0)
                {
                    _Cursor = MAIN_ITEMS - 1;
                }
                break;

            case KeysDef.K_ENTER:
                Host.Menu.EnterSound = true;

                switch (_Cursor)
                {
                case 0:
                    SinglePlayerMenu.Show(Host);
                    break;

                case 1:
                    MultiPlayerMenu.Show(Host);
                    break;

                case 2:
                    OptionsMenu.Show(Host);
                    break;

                case 3:
                    HelpMenu.Show(Host);
                    break;

                case 4:
                    QuitMenu.Show(Host);
                    break;
                }
                break;
            }
        }
Exemple #3
0
        public override void KeyEvent(Int32 key)
        {
            switch (key)
            {
            case KeysDef.K_ESCAPE:
                SinglePlayerMenu.Show(Host);
                break;

            case KeysDef.K_ENTER:
                Host.Sound.LocalSound("misc/menu2.wav");
                if (!_Loadable[_Cursor])
                {
                    return;
                }
                CurrentMenu.Hide( );

                // Host_Loadgame_f can't bring up the loading plaque because too much
                // stack space has been used, so do it now
                Host.Screen.BeginLoadingPlaque( );

                // issue the load command
                Host.Commands.Buffer.Append(String.Format("load s{0}\n", _Cursor));
                return;

            case KeysDef.K_UPARROW:
            case KeysDef.K_LEFTARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor--;
                if (_Cursor < 0)
                {
                    _Cursor = MAX_SAVEGAMES - 1;
                }
                break;

            case KeysDef.K_DOWNARROW:
            case KeysDef.K_RIGHTARROW:
                Host.Sound.LocalSound("misc/menu1.wav");
                _Cursor++;
                if (_Cursor >= MAX_SAVEGAMES)
                {
                    _Cursor = 0;
                }
                break;
            }
        }