Beispiel #1
0
 public TraceToDraw(MainForm mainForm, Timer timer2, PictureBox mainPictureBox, string uid)
 {
     this.mainForm = mainForm;
     this.timer2 = timer2;
     this.mainPictureBox = mainPictureBox;
     this.uid = uid;
     lines = new List<Line>();
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string username = this.textBox1.Text;
            string password = this.textBox2.Text;
            if (checkLogin(username,password))
            {
                UserModel userModel = new UserModel();
                userModel.username = username;
                userModel.uid = uid;
                userModel.score = score;
                if (int.Parse(Util.getmydrawnum(uid)) > 0)
                {
                    if (MessageBox.Show("有朋友给您发送了未猜的图画,是否要开始猜图?(一次只能猜测一幅画)", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        string drawthing = Util.getdrawthing(uid);
                        MainForm mainForm = new MainForm(userModel, userModel, drawthing, "guess");
                        mainForm.Show();
                        this.Hide();
                    }
                    else
                    {
                        FindPartnerForm findPartnerForm = new FindPartnerForm(userModel);
                        findPartnerForm.Show();
                        this.Hide();
                    }
                }
                else
                {
                    FindPartnerForm findPartnerForm = new FindPartnerForm(userModel);
                    findPartnerForm.Show();
                    this.Hide();
                }

            }
            else
            {
                MessageBox.Show("登陆失败,请再填写用户名和密码并重新登陆。");
            }
        }
 //开始游戏
 private void button2_Click(object sender, EventArgs e)
 {
     if (this.textBox_drawthing.Text == "")
     {
         MessageBox.Show("请输入要画的东西。");
         this.textBox_drawthing.Focus();
     }
     else
     {
         MainForm mainForm = new MainForm(userModel, f_userModel, this.textBox_drawthing.Text,"draw");
         mainForm.Show();
         this.Hide();
     }
 }
 public InputDrawthingAgainForm(MainForm mainForm)
 {
     InitializeComponent();
     this.mainForm = mainForm;
 }