private void lblBedroom_Click(object sender, EventArgs e) { BedroomForm bForm = new BedroomForm(); bForm.StartPosition = FormStartPosition.Manual; //设置窗体第一次出现的位置 bForm.Location = new Point(this.Location.X, this.Location.Y); //设置窗体出现的坐标 bForm.Show(); close = true; //允许关闭本窗体 this.Close(); }
//“听天由命”按钮 private void lblAuto_Click(object sender, EventArgs e) { //调用英雄初始化属性方法(请编码实现) GameManager.GameInfo.Hero.Create(); BedroomForm bForm = new BedroomForm(); bForm.StartPosition = FormStartPosition.Manual; //设置窗体第一次出现的位置 bForm.Location = new Point(this.Location.X, this.Location.Y); //设置窗体出现的坐标 bForm.Show(); close = true; //允许关闭本窗体 this.Close(); }
/// <summary> /// 读档(请编码实现) /// </summary> private void lblLoad_Click(object sender, EventArgs e) { //获取当前应用程序下的data文件夹 ofDlg.InitialDirectory = Application.StartupPath + @"\data\"; DialogResult result = ofDlg.ShowDialog(); if(result == DialogResult.OK) { //读取玩家存档信息 GameManager.Load(ofDlg.FileName); //跳转到寝室 BedroomForm bForm = new BedroomForm(); bForm.StartPosition = FormStartPosition.Manual; bForm.Location = new Point(this.Location.X, this.Location.Y); bForm.Show(); } }
/// <summary> /// 读档(请编码实现) /// </summary> private void lblLoad_Click(object sender, EventArgs e) { //获取当前应用程序下的data文件夹 ofDlg.InitialDirectory = Application.StartupPath + @"\data\"; DialogResult result = ofDlg.ShowDialog(); if (result == DialogResult.OK) { //读取玩家存档信息 GameManager.Load(ofDlg.FileName); //跳转到寝室 BedroomForm bForm = new BedroomForm(); bForm.StartPosition = FormStartPosition.Manual; bForm.Location = new Point(this.Location.X, this.Location.Y); bForm.Show(); } }