Ejemplo n.º 1
0
        public bool YesOrNoPrompt(string s, bool easy_cancel)
        {
            player.Interrupt();
            MouseUI.PushButtonMap(MouseMode.YesNoPrompt);
            MouseUI.CreateButton(ConsoleKey.Y, false, 2, Global.MAP_OFFSET_COLS + s.Length + 1, 1, 2);
            MouseUI.CreateButton(ConsoleKey.N, false, 2, Global.MAP_OFFSET_COLS + s.Length + 4, 1, 2);
            if (MouseUI.descend_hack && Actor.viewing_more_commands)
            {
                MouseUI.CreateStatsButton(ConsoleKey.N, false, 16, 1);
                MouseUI.descend_hack = false;
            }
            DisplayNow(s + " (y/n): ");
            Screen.CursorVisible = true;
            while (true)
            {
                switch (Global.ReadKey().KeyChar)
                {
                case 'y':
                case 'Y':
                    MouseUI.PopButtonMap();
                    return(true);

                case 'n':
                case 'N':
                    MouseUI.PopButtonMap();
                    return(false);

                default:
                    if (easy_cancel)
                    {
                        MouseUI.PopButtonMap();
                        return(false);
                    }
                    break;
                }
            }
        }