Exemple #1
0
        private void EnterAction()
        {
            if (nick.Trim().Length <= 0)
            {
                //cw invalid name
                Elements["alert"].Update();
                Audio.StartServiceTrack("invalid");

                Console.SetCursorPosition(nickname.PosX, nickname.PosY);
                return;
            }

            exit = true;
            Console.CursorVisible = false;
            Audio.StopTrack();
            SongSelectionView songSelectionView = new SongSelectionView(nick.Trim());

            songSelectionView.Init();
        }
Exemple #2
0
        public void Init()
        {
            Audio.StartServiceTrack("menu", true);
            pressedKey = new ConsoleKeyInfo();
            Render();

            t = new Thread(delegate()
            {
                do
                {
                    pressedKey = Console.ReadKey(true);
                } while (true);
            });

            Thread.Sleep(100);
            AnimateMenuItem();
            t.Start();

            exit = false;
            do
            {
                switch (pressedKey.Key)
                {
                case ConsoleKey.D1:
                    Audio.StopTrack();
                    t.Abort();
                    exit = true;
                    Menu.Play();
                    break;

                case ConsoleKey.D2:
                    Audio.StopTrack();

                    Menu.Rank();
                    pressedKey = new ConsoleKeyInfo();

                    break;

                case ConsoleKey.D3:
                    Menu.Exit();
                    break;

                case ConsoleKey.Escape:
                    Menu.Exit();
                    break;

                case ConsoleKey.DownArrow:
                    MoveSelectedDown();
                    pressedKey = new ConsoleKeyInfo();
                    break;

                case ConsoleKey.UpArrow:
                    MoveSelectedUp();
                    pressedKey = new ConsoleKeyInfo();
                    break;

                case ConsoleKey.Enter:
                    Audio.StopTrack();

                    EnterAction();
                    break;
                }
            } while (!exit);
        }