Пример #1
0
        /// <summary>
        /// Sets up the controls of the GUI so that the appropriate components are enabled or disable
        /// while in the playing game state.
        /// </summary>
        public void SetUpControlsInGame()
        {
            // All of the fields a user shouldn't be able to change during a game.
            Enter_Game_Button.Enabled = false;

            // Hide the desired time limit cause it's distracting
            DesiredTimeLimit_Label.Hide();
            TimeLimit_Textbox.Hide();

            // Let the user now submit words.
            Word_Textbox.Enabled = true;
            Enter_Button.Enabled = true;
        }
Пример #2
0
        /// <summary>
        /// Sets up the controls so that all of the appropriate components are enabled and disabled
        /// for the stage that occurs after hitting the register button.
        /// </summary>
        public void SetUpControlsAfterRegister()
        {
            // Disable the appropriate controls so the user doesn't mess things up.
            CancelRegister_Button.Enabled = false;
            Cancel_Game_Button.Enabled    = false;

            // Show the desired time limit so the user can enter in their desired time limit.
            DesiredTimeLimit_Label.Show();
            TimeLimit_Textbox.Show();

            // Enable the proper controls so that the user can perform the appopriate actions.
            Username_Textbox.Enabled    = true;
            ServerName_Textbox.Enabled  = true;
            TimeLimit_Textbox.Enabled   = true;
            RegisterUser_Button.Enabled = true;
            Enter_Game_Button.Enabled   = true;
        }
Пример #3
0
        public void Reset()
        {
            // Reset the board and the default server name, as well as all other text fields.
            Field0.Text             = "";
            Field1.Text             = "";
            Field2.Text             = "";
            Field3.Text             = "";
            Field4.Text             = "";
            Field5.Text             = "";
            Field6.Text             = "";
            Field7.Text             = "";
            Field8.Text             = "";
            Field9.Text             = "";
            Field10.Text            = "";
            Field11.Text            = "";
            Field12.Text            = "";
            Field13.Text            = "";
            Field14.Text            = "";
            Field15.Text            = "";
            ServerName_Textbox.Text = "http://ice.eng.utah.edu";
            SetOpponentScore("0");
            SetPlayerScore("0");
            ScoreBoard_Textbox.ResetText();
            SetOpponentNickname("...");
            SetRemainingTime("0");
            SetTimeLimit("0");

            // Go back to the very beginning, where the user has to reregister in order to play again.
            Cancel_Game_Button.Enabled    = false;
            CancelRegister_Button.Enabled = false;
            Enter_Game_Button.Enabled     = false;
            Enter_Button.Enabled          = false;
            Word_Textbox.Enabled          = false;
            TimeLimit_Textbox.Enabled     = false;

            // Hide the time limit stuff so the user doesn't see it.
            DesiredTimeLimit_Label.Hide();
            TimeLimit_Textbox.Hide();

            // Make it so the user can interact with only these three things.
            Username_Textbox.Enabled    = true;
            ServerName_Textbox.Enabled  = true;
            RegisterUser_Button.Enabled = true;
        }