Exemple #1
0
 public void SetGames(CharaData.CharaInfo[] charaList)
 {
     games = new string[1];
     int count = 0;
     bool found;
     foreach (CharaData.CharaInfo chara in charaList)
     {
         foreach (string game in chara.game)
         {
             found = false;
             foreach (string item in games)
             {
                 if (item == game)
                 {
                     found = true;
                     break;
                 }
             }
             if (!found)
             {
                 if (count >= games.Length) Array.Resize(ref games, count * 2);
                 games[count] = game;
                 count++;
             }
         }
     }
     Array.Resize(ref games, count);
     Array.Sort(games);
 }
Exemple #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     sizesaver = new WindowSizeSaver(this);
     try
     {
         using (StreamReader sr = new StreamReader("CharaBox3.ini"))
         {
             string line;
             string[] item;
             char[] sep = new char[] { '\t' };
             FormWindowState state = FormWindowState.Normal;
             while ((line = sr.ReadLine()) != null)
             {
                 item = line.Split(sep);
                 switch (item[0])
                 {
                     case "File":
                         Array.Resize(ref files, files.Length + 1);
                         files[files.Length - 1].name = item[1];
                         files[files.Length - 1].file = item[2];
                         miMainFile.DropDown.Items.Add(item[1], null, new EventHandler(miMainFile_Click));
                         break;
                     case "Location":
                         this.Left = int.Parse(item[1]);
                         this.Top = int.Parse(item[2]);
                         break;
                     case "Size":
                         this.Width = int.Parse(item[1]);
                         this.Height = int.Parse(item[2]);
                         break;
                     case "State":
                         state = (FormWindowState)int.Parse(item[1]);
                         break;
                     default: break;
                 }
             }
             this.WindowState = state;
         }
     }
     catch (Exception)
     {
     }
     if (files.Length == 0)
     {
         Array.Resize(ref files, files.Length + 1);
         files[files.Length - 1].name = "デフォルト";
         files[files.Length - 1].file = "default.dat";
         miMainFile.DropDown.Items.Add(files[files.Length - 1].name, null, new EventHandler(miMainFile_Click));
     }
     data = new CharaData(files[0].file);
     imgDefault = picImage.Image;
     pnlInfoUpper.Height = cmbName.Height * 3;
     lblName.Left = lblGame.Left = lblInfo.Left = 0;
     lblName.Height = lblGame.Height = lblInfo.Height = lblGame.Top = cmbGame.Top = cmbName.Height;
     lblInfo.Top = cmbInfo.Top = cmbName.Height * 2;
     lblGame.Width = lblInfo.Width = cmbName.Left = cmbGame.Left = cmbInfo.Left = lblName.Width;
     data.Load();
     ChangeView(ViewMode.ABC);
     LayoutInfo();
 }
Exemple #3
0
 public ComparerUpdate(ref CharaData.CharaInfo[] c)
 {
     chara = c;
 }
Exemple #4
0
 public ComparerSize(ref CharaData.CharaInfo[] c)
 {
     chara = c;
     size = new double[chara.Length];
     for (int i = 0; i < chara.Length; i++)
     {
         size[i] = chara[i].size != "" ? CharaData.pqaSize.GetValue(chara[i].size) : -1;
     }
 }
Exemple #5
0
 public ComparerSex(ref CharaData.CharaInfo[] c)
 {
     chara = c;
 }
Exemple #6
0
 public ComparerGraphics(ref CharaData.CharaInfo[] c)
 {
     chara = c;
 }
Exemple #7
0
 public ComparerGame(ref CharaData.CharaInfo[] c)
 {
     chara = c;
 }
Exemple #8
0
 public ComparerFind(ref CharaData.CharaInfo[] c, CharaData.FindCondition f)
 {
     chara = c;
     match = new bool[chara.Length];
     for (int i = 0; i < chara.Length; i++) match[i] = f.Match(chara[i]);
 }
Exemple #9
0
 public ComparerDescription(ref CharaData.CharaInfo[] c)
 {
     chara = c;
 }
Exemple #10
0
 public ComparerAge(ref CharaData.CharaInfo[] c)
 {
     chara = c;
     age = new double[chara.Length];
     for (int i = 0; i < chara.Length; i++)
     {
         age[i] = chara[i].age != "" ? CharaData.pqaAge.GetValue(CharaData.GetAgeString(chara[i].age)) : -1;
     }
 }
Exemple #11
0
 private void ssBottom_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Middle)
     {
         FormEdit fe = new FormEdit();
         PhysicalQuantityAnalyzer pqa = new PhysicalQuantityAnalyzer(PhysicalQuantityAnalyzer.Word.def);
         fe.SetGames(data.chara);
         char[] a = "abcd".ToCharArray(), b = "efgh".ToCharArray();
         char[] c = new char[a.Length + b.Length];
         a.CopyTo(c, 0);
         b.CopyTo(c, a.Length);
         fe.chara.game = new string[] {
             "0→" + pqa.GetValue("0").ToString(),
             "5→" + pqa.GetValue("5").ToString(),
             "5687→" + pqa.GetValue("5687").ToString(),
             "3.1416→" + pqa.GetValue("3.1416").ToString(),
             "3.141592653589793238→" + pqa.GetValue("3.141592653589793238").ToString(),
             "0.0→" + pqa.GetValue("0.0").ToString(),
             "一二三→" + pqa.GetValue("一二三").ToString(),
             "三十円→" + pqa.GetValue("三十円").ToString(),
             "十一万五千円→" + pqa.GetValue("十一万五千円").ToString(),
             "1億2345万6789→" + pqa.GetValue("1億2345万6789").ToString(),
             "1.23456万円→" + pqa.GetValue("1.23456万円").ToString(),
             "0.0000000000001億→" + pqa.GetValue("0.0000000000001億").ToString(),
             new string(c),
         };
         fe.ShowDialog(this);
         if (!fe.Canceled)
         {
             data.Save();
             data = new CharaData(fe.chara.name[0]);
             data.Load();
             RefreshView();
         }
     }
 }
Exemple #12
0
 private void miMainOpen_Click(object sender, EventArgs e)
 {
     string cd = Directory.GetCurrentDirectory();
     if (ofdFile.ShowDialog() == DialogResult.OK)
     {
         Directory.SetCurrentDirectory(cd);
         CharaData d= new CharaData(ofdFile.FileName);
         if (d.Load())
         {
             data.Save();
             data = d;
             RefreshView();
         }
         else
         {
             MessageBox.Show("CharaBox3のファイルでないため開けませんでした!");
         }
     }
 }
Exemple #13
0
 private void miMainFile_Click(object sender, EventArgs e)
 {
     foreach (DataFiles f in files)
     {
         if (f.name == sender.ToString())
         {
             data.Save();
             data = new CharaData(f.file);
             data.Load();
             RefreshView();
         }
     }
 }