This repository has been archived on 2024-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
CDSAE3/CDSAE3_Lian_Lian_Kan/Forms/FinishedMessageBox.cs

45 lines
1.5 KiB
C#
Raw Permalink Normal View History

2024-04-18 00:38:59 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public partial class FinishedMessageBox : Form
{
public FinishedMessageBox()
{
InitializeComponent();
}
int score = 0;
int costTime = 0;
public FinishedMessageBox(int score,int costTime)
{
InitializeComponent();
2024-04-22 05:48:40 +00:00
Location = new Point(Etcs.form!.Left + Etcs.form.Width - Width / 2, Etcs.form.Top + Etcs.form.Height + Height / 2);
2024-04-18 00:38:59 +00:00
this.score = score;
this.costTime = costTime;
scoreLabel.Text = "分数:" + score.ToString();
scoreLabel.Location = new Point((649 - scoreLabel.Size.Width) / 2, scoreLabel.Location.Y);
}
private void nameTextBox_Enter(object sender, EventArgs e)
{
nameTextBox.Font = new Font("Microsoft YaHei UI", 15F);
nameTextBox.ForeColor = Color.FromArgb(0,0,0);
nameTextBox.Text = "";
}
private void _Click(object sender, EventArgs e)
{
Etcs.charts.AddRecord(new Etcs.RecordInfo { Name = nameTextBox.Text==""?"Anonymous": nameTextBox.Text ,Score = score,Time = DateTime.Now,CostTime = costTime,Difficulty = Etcs.current_difficulty.ToString()});
Close();
}
}
}