public Form1() { InitializeComponent(); data = new PersonalData(); dataGettingProgress.Maximum = 100; }
private void getDataButton_Click(object sender, EventArgs e) { data = new PersonalData(); if (webBrowser.Document == null) { labelNameValue.Text = "は?"; return; } data.name = getElementValue("base.name"); if (data.name == "" || data.name == null) { labelNameValue.Text = "まだページがロードされていないか、名前が空です"; return; } labelNameValue.Text = "◆出力中です"; dataGettingProgress.Value = 0; data.肉体.value = int.Parse(getElementValue("baseAbility.body.subtotal")); data.感覚.value = int.Parse(getElementValue("baseAbility.sense.subtotal")); data.精神.value = int.Parse(getElementValue("baseAbility.mind.subtotal")); data.社会.value = int.Parse(getElementValue("baseAbility.society.subtotal")); data.肉体.children.Add(new TupleItem <string, int>("白兵", getElementValueAsInt("skills.hak.A.lv"))); data.肉体.children.Add(new TupleItem <string, int>("回避", getElementValueAsInt("skills.kai.A.lv"))); data.感覚.children.Add(new TupleItem <string, int>("射撃", getElementValueAsInt("skills.sha.A.lv"))); data.感覚.children.Add(new TupleItem <string, int>("知覚", getElementValueAsInt("skills.tik.A.lv"))); data.精神.children.Add(new TupleItem <string, int>("RC", getElementValueAsInt("skills.rc.A.lv"))); data.精神.children.Add(new TupleItem <string, int>("意思", getElementValueAsInt("skills.isi.A.lv"))); data.社会.children.Add(new TupleItem <string, int>("交渉", getElementValueAsInt("skills.kou.A.lv"))); data.社会.children.Add(new TupleItem <string, int>("調達", getElementValueAsInt("skills.tyo.A.lv"))); //ここからB技能(めんどくさい) int abilityNumber = 0; while (processNextBAbility(abilityNumber)) { abilityNumber++; } dataGettingProgress.Value = 10; int comboNumber = 0; while (processNextCombo(comboNumber)) { comboNumber++; } dataGettingProgress.Value = 20; var json = new DX3rdJsonData(); string[] shifts = { "0%", "60%", "80%", "100%", "130%" }; for (var i = 0; i < 5; i++) { var info = new DX3rdJsonData.SaveData.TabInfo(); info.tabName = shifts[i]; CreatePage(i, info); json.saveData.tabInfos.Add(info); } dataGettingProgress.Value = 50; var serializer = new DataContractJsonSerializer(typeof(DX3rdJsonData)); var fs = new FileStream($"{data.name}_CP.cpd", FileMode.Create); try { serializer.WriteObject(fs, json); } finally { fs.Close(); } dataGettingProgress.Value = 100; labelNameValue.Text = "◆出力が完了しました(exeと同じフォルダにあると思います)"; }