コード例 #1
0
ファイル: Main_Form.cs プロジェクト: yychieh1031/HsiuHsien
 //
 // Create Character
 //
 private void button10_Click(object sender, System.EventArgs e)
 {
     // Create Character option
     if (String.IsNullOrEmpty(act.Act_Ch_No))
     {
         Ch_Sts.create(ch, ref act);
         #region textbox/button enable
         textBox2.Enabled  = true;
         textBox3.Enabled  = true;
         textBox4.Enabled  = true;
         textBox5.Enabled  = true;
         textBox6.Enabled  = true;
         textBox7.Enabled  = true;
         textBox8.Enabled  = true;
         textBox9.Enabled  = true;
         textBox10.Enabled = true;
         textBox11.Enabled = true;
         textBox12.Enabled = true;
         textBox13.Enabled = true;
         textBox14.Enabled = true;
         textBox15.Enabled = true;
         textBox16.Enabled = true;
         textBox17.Enabled = true;
         button1.Enabled   = true;
         button2.Enabled   = true;
         button3.Enabled   = true;
         button4.Enabled   = true;
         button5.Enabled   = true;
         button6.Enabled   = true;
         button7.Enabled   = true;
         button8.Enabled   = true;
         button9.Enabled   = true;
         #endregion
         ch           = Ch_Sts.get(act.Act_Ch_No);
         btrpt.Ch_Dtl = ch;
         UIDisplay(btrpt);
         button10.Text = "Logout";
         // Initial Room set
         Ro_Rou.post(btrpt);
         btrpt.room = Ro_Sts.get(btrpt);
         output.AppendText("You are in " + btrpt.room.Ro_Nm);
         output.AppendText(Environment.NewLine);
     }
     else  // Logout option
     {
         btrpt.Ch_Dtl.Ch_Nm = "";
         Login_Form login = new Login_Form(this);
         login.Owner = this;
         login.Show();
     }
 }
コード例 #2
0
ファイル: Main_Form.cs プロジェクト: yychieh1031/HsiuHsien
        public void reload()
        {
            if (String.IsNullOrEmpty(act.Act_Ch_No))
            {
                button10.Text = "Create";
                #region textbox/button disable
                textBox2.Enabled  = false;
                textBox3.Enabled  = false;
                textBox4.Enabled  = false;
                textBox5.Enabled  = false;
                textBox6.Enabled  = false;
                textBox7.Enabled  = false;
                textBox8.Enabled  = false;
                textBox9.Enabled  = false;
                textBox10.Enabled = false;
                textBox11.Enabled = false;
                textBox12.Enabled = false;
                textBox13.Enabled = false;
                textBox14.Enabled = false;
                textBox15.Enabled = false;
                textBox16.Enabled = false;
                textBox17.Enabled = false;
                button1.Enabled   = false;
                button2.Enabled   = false;
                button3.Enabled   = false;
                button4.Enabled   = false;
                button5.Enabled   = false;
                button6.Enabled   = false;
                button7.Enabled   = false;
                button8.Enabled   = false;
                button9.Enabled   = false;
                #endregion
                output.AppendText("Please Insert Character Name..");
                output.AppendText(Environment.NewLine);
            }
            else
            {
                button10.Text = "Logout";
                ch            = Ch_Sts.get(act.Act_Ch_No);
                btrpt.Ch_Dtl  = ch;
                btrpt.Acc_Dtl = act;

                btrpt.room = Ro_Sts.get(btrpt);
                output.AppendText("You are in " + btrpt.room.Ro_Nm);
                output.AppendText(Environment.NewLine);
            }
            UIDisplay(btrpt);
        }
コード例 #3
0
ファイル: Main_Form.cs プロジェクト: yychieh1031/HsiuHsien
        //
        // Training
        //
        private void button4_Click(object sender, System.EventArgs e)
        {
            Random rnd         = new Random();
            int    trainingExp = 0;

            for (int time = 1; time <= 10; time++)
            {
                trainingExp += rnd.Next(Convert.ToInt32(ch.Lv) * 10);
                Thread.Sleep(1000);
                output.AppendText(String.Format("Training...{0}%", time * 10));
                output.AppendText(Environment.NewLine);
            }
            output.AppendText("Training Done");
            output.AppendText(Environment.NewLine);
            output.AppendText(String.Format("You get {0} EXP", trainingExp));
            output.AppendText(Environment.NewLine);
            btrpt.Ch_Dtl.EXP = (Convert.ToInt32(btrpt.Ch_Dtl.EXP) + trainingExp).ToString();
            Ch_Sts.update(btrpt.Ch_Dtl);
            UIDisplay(btrpt);
        }