Пример #1
0
        private void Begin_Click(object sender, EventArgs e)
        {
            string text = PlayerName.Text;

            if (text == null || text == "")
            {
                AlertForm alertForm = new AlertForm("玩家名不能为空!");
                alertForm.ShowDialog();
                return;
            }
            Game newGame = new Game();

            newGame.CurTurn     = 0;
            newGame.GameChapter = GameSystem.ChapterList[ChapterIdx];
            newGame.PlayerName  = text;
            newGame.Buff        = 0;
            newGame.Pressure    = 50;
            newGame.IfNight     = 0;
            MakePlan makePlan = new MakePlan(newGame);

            makePlan.TopLevel = false;
            this.Parent.Controls.Add(makePlan);
            this.Parent.Controls.Remove(this);
            makePlan.Show();
            this.Close();
        }
Пример #2
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     if (GameSystem.ErrorCode != 0)
     {
         AlertForm alertForm = new AlertForm(GameSystem.ErrMsg[GameSystem.ErrorCode]);
         alertForm.ShowDialog();
         Application.Exit();
     }
 }
Пример #3
0
 private void BtnNight_Click(object sender, EventArgs e)
 {
     if (StatusList[3] == true)
     {
         PlanList[3] = new Course();
         SetRightFocus(GetRightFocus(), e);
         DisableLabel(3, "好好休息");
         BtnNight.Text = "今晚通宵学习!";
     }
     else
     {
         if (Gamest.IfNight != 0)
         {
             AlertForm alertForm = new AlertForm("昨晚已经通宵过了!今晚再通宵会要命的!");
             alertForm.ShowDialog();
             return;
         }
         EnableLabel(3);
         SetRightFocus(PlanLabelList[3], e);
         BtnNight.Text = "还是好好休息吧!";
     }
 }
Пример #4
0
        private void DoubleClickMid(object sender, EventArgs e)
        {
            if (RightBarFocus == null)
            {
                return;
            }
            if (RightFocus == -1)
            {
                return;
            }
            MidBarFocus = (Label)sender;
            Course ToReview  = (from course in Gamest.GameChapter.CourseList where MidBarFocus.Name == course.CourseName select course).ToList()[0];
            Course newCourse = new Course(ToReview);

            if (Gamest.CurTurn == newCourse.Deadline && RightFocus > newCourse.TestPeriod)
            {//在考试之后复习,禁止这种操作
                AlertForm alertForm = new AlertForm($"这门课在{GameSystem.TimeName[newCourse.TestPeriod]}就已经考完了!");
                alertForm.ShowDialog();
                return;
            }
            PlanList[RightFocus] = newCourse;
            RightBarFocus.Text   = MidBarFocus.Text;
            SetRightFocus(GetRightFocus(RightFocus), e);
        }