private void FECipherVit_Load(object sender, EventArgs e)
 {
     File.Delete("decktemp");
     Player = new User();
     Rival = new User();
     msgProcessor = new MsgProcessor(this);
     string[] CardDataTemp = File.ReadAllLines("CardData.fe0db", Encoding.UTF8);
     CardData = new List<string[]>();
     foreach (string carddatumtemp in CardDataTemp)
     {
         string[] temp = carddatumtemp.Split(new char[] { ',' }, StringSplitOptions.None);
         CardData.Add(temp);
     }
     CardData.Sort(delegate (string[] x, string[] y)
     {
         return Convert.ToInt32(x[0]) - Convert.ToInt32(y[0]);
     });
     try
     {
         pictureBoxCardInfo.Image = Image.FromFile(@"img/back.jpg");
     }
     catch
     {
         pictureBoxCardInfo.Image = pictureBoxCardInfo.ErrorImage;
     }
     ConnectionRenew();
     connection = new Connection(this);
     connection.ShowDialog();
     ContextMenuStripRenew();
     UpdateThread = new Thread(new ThreadStart(CheckUpdate));
     UpdateThread.Start();
 }
Beispiel #2
0
 private void FECipherVit_Load(object sender, EventArgs e)
 {
     if (SpeVer.Contains("Compi"))
     {
         DisablePlaying();
     }
     if (SpeVer.Contains("Judge"))
     {
         开启裁判功能ToolStripMenuItem.Visible = true;
     }
     File.Delete("decktemp");
     Player = new User(this);
     Rival = new User(this);
     msgProcessor = new MsgProcessor(this);
     report = res.GetString("report_string1", Thread.CurrentThread.CurrentUICulture) + DateTime.Now.ToString();
     try
     {
         string[] CardDataTemp;
         if (Language == Language.Chinese)
         {
             CardDataTemp = File.ReadAllLines("CardData.fe0db", Encoding.UTF8);
         }
         else
         {
             CardDataTemp = File.ReadAllLines("CardData_En.fe0db", Encoding.UTF8);
         }
         CardData = new Dictionary<string, string[]>();
         foreach (string carddatumtemp in CardDataTemp)
         {
             if (carddatumtemp.Contains("USO"))
             {
                 continue;
             }
             string[] temp = carddatumtemp.Split(new char[] { ',' }, StringSplitOptions.None);
             if (Language == Language.English && temp.Length >= 19)
             {
                 temp[4] = temp[4].Replace("%%", ",");
                 temp[16] = temp[16].Replace("%%", ",");
                 temp[17] = temp[17].Replace("%%", ",");
             }
             CardData.Add(temp[0], temp);
             if (temp.Length >= 19 && temp[18] == "2")
             {
                 string[] temp2 = (string[])temp.Clone();
                 temp2[0] += "+";
                 temp2[2] += "+";
                 CardData.Add(temp2[0], temp2);
             }
         }
         DatabaseVer = int.Parse(CardData["0"][2]);
         try
         {
             pictureBoxCardInfo.Image = Image.FromFile(@"img/back.jpg");
         }
         catch
         {
             pictureBoxCardInfo.Image = pictureBoxCardInfo.ErrorImage;
         }
     }
     catch
     {
         MessageBox.Show(res.GetString("LoadCardData_string1", Thread.CurrentThread.CurrentUICulture), res.GetString("LoadCardData_caption", Thread.CurrentThread.CurrentUICulture));
         Application.Exit();
     }
     if (Language == Language.Chinese)
     {
         UpdateGetMsgTextBox("欢迎使用FECipherVit。\r\n程序版本号:" + Version.ToString() + " " + SpeVer + "\r\n数据库版本号:" + DatabaseVer.ToString());
     }
     else
     {
         UpdateGetMsgTextBox("Welcome to FECipherVit.\r\nVersion: " + Version.ToString() + " " + SpeVer + "\r\nDatabase version: " + DatabaseVer.ToString());
     }
     ConnectionRenew();
     connection = new Connection(this);
     connection.ShowDialog();
     historychecker = new HistoryChecker(this);
     ContextMenuStripRenew();
     CreateThumbnailsThread = new Thread(new ThreadStart(CheckCardImgs));
     CreateThumbnailsThread.Start();
 }