Ejemplo n.º 1
0
        private void InitializeSpectateSubMenu()
        {
            Console.Clear();
            InputUtilities.ClearKeyBuffer();

            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(MenuArt.JustPoChessLogoUpper);

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(MenuArt.JustPoChessSpectate);

            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(MenuArt.JustPoChessLogoDown);

            Console.WriteLine();

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(MenuArt.LocalText);
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(MenuArt.RemoteText);
            Console.WriteLine(MenuArt.BackText);

            var menuOptions = 1;

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    var userInput = Console.ReadKey();
                    switch (userInput.Key)
                    {
                    case ConsoleKey.UpArrow:
                        Sound.PlayTraverseSound();
                        if (menuOptions == 1)
                        {
                            menuOptions = 3;
                        }
                        else
                        {
                            menuOptions--;
                        }
                        break;

                    case ConsoleKey.DownArrow:
                        Sound.PlayTraverseSound();
                        if (menuOptions == 3)
                        {
                            menuOptions = 1;
                        }
                        else
                        {
                            menuOptions++;
                        }
                        break;

                    case ConsoleKey.Enter:
                        switch (menuOptions)
                        {
                        case 1:
                            Sound.PlaySelectionSound();
                            break;

                        case 2:
                            Sound.PlaySelectionSound();
                            break;

                        case 3:
                            Sound.PlaySelectionSound();
                            InitializeMenu();
                            break;
                        }
                        break;
                    }

                    Console.Clear();

                    switch (menuOptions)
                    {
                    case 1:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessSpectate);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.LocalText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.RemoteText);
                        Console.WriteLine(MenuArt.BackText);
                        break;

                    case 2:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessSpectate);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.WriteLine(MenuArt.LocalText);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.RemoteText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.BackText);
                        break;

                    case 3:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessSpectate);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.WriteLine(MenuArt.LocalText);
                        Console.WriteLine(MenuArt.RemoteText);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.BackText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        break;
                    }

                    Thread.Sleep(50);
                    InputUtilities.ClearKeyBuffer();
                }
            }
        }
Ejemplo n.º 2
0
        public void InitializeMenu()
        {
            Console.Clear();
            InputUtilities.ClearKeyBuffer();

            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(MenuArt.JustPoChessLogoUpper);

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(MenuArt.JustPoChessMenu);

            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(MenuArt.JustPoChessLogoDown);

            Console.WriteLine();

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(MenuArt.StartServerText);
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine(MenuArt.PlayText);
            Console.WriteLine(MenuArt.SpectateText);
            Console.WriteLine(MenuArt.ExitText);

            var menuOptions = 1;

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    var userInput = Console.ReadKey();
                    switch (userInput.Key)
                    {
                    case ConsoleKey.UpArrow:
                        Sound.PlayTraverseSound();
                        if (menuOptions == 1)
                        {
                            menuOptions = 4;
                        }
                        else
                        {
                            menuOptions--;
                        }
                        break;

                    case ConsoleKey.DownArrow:
                        Sound.PlayTraverseSound();
                        if (menuOptions == 4)
                        {
                            menuOptions = 1;
                        }
                        else
                        {
                            menuOptions++;
                        }
                        break;

                    case ConsoleKey.Enter:
                        switch (menuOptions)
                        {
                        case 1:
                            Sound.PlaySelectionSound();
                            InitializeStartServerSubMenu();
                            break;

                        case 2:
                            Sound.PlaySelectionSound();
                            InitializePlaySubMenu();
                            break;

                        case 3:
                            Sound.PlaySelectionSound();
                            InitializeSpectateSubMenu();
                            break;


                        case 4:
                            Sound.PlaySelectionSound();
                            Environment.Exit(0);
                            break;
                        }
                        break;
                    }

                    Console.Clear();

                    switch (menuOptions)
                    {
                    case 1:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessMenu);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.StartServerText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.PlayText);
                        Console.WriteLine(MenuArt.SpectateText);
                        Console.WriteLine(MenuArt.ExitText);
                        break;

                    case 2:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessMenu);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.WriteLine(MenuArt.StartServerText);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.PlayText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.SpectateText);
                        Console.WriteLine(MenuArt.ExitText);
                        break;

                    case 3:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessMenu);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.WriteLine(MenuArt.StartServerText);
                        Console.WriteLine(MenuArt.PlayText);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.SpectateText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.ExitText);
                        break;

                    case 4:
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoUpper);

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.JustPoChessMenu);

                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        Console.WriteLine(MenuArt.JustPoChessLogoDown);

                        Console.WriteLine();

                        Console.WriteLine(MenuArt.StartServerText);
                        Console.WriteLine(MenuArt.PlayText);
                        Console.WriteLine(MenuArt.SpectateText);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(MenuArt.ExitText);
                        Console.ForegroundColor = ConsoleColor.DarkGray;
                        break;
                    }

                    Thread.Sleep(50);
                    InputUtilities.ClearKeyBuffer();
                }
            }
        }