Exemple #1
0
        /// <summary>
        /// Prompts players to select one the players.
        /// </summary>
        /// <param name="players">The available options.</param>
        /// <param name="title">The title for the dialog.</param>
        /// <returns>Index value of the selected player.</returns>
        public int PromptPlayerSelection(Player[] players, string title)
        {
            int        value;
            string     helpText;
            UIPosition position;
            UIDialog   dialog;

            position = new UIPosition(0, 1);

            helpText = "Use A, D or ArrowLeft and ArrowRight to select one " +
                       "of the buttons bellow and then press Enter.";

            dialog = new UIDialog("userSelection", position, title,
                                  helpText, players[0].Name, players[1].Name);

            Screen.Add(dialog, UITitleRef.BottomLeft);

            dialog.Display();

            value = dialog.GetSelected();

            Screen.Remove();

            return(value);
        }