private void SetObjects() { mapIdNum1.Maximum = TreasureCalc.max_MapCell; mapIdNum2.Maximum = TreasureCalc.max_MapCell; mapIdNum3.Maximum = TreasureCalc.max_MapCell * TreasureCalc.max_MapCell - 1; for (int i = 0; i < TreasureCalc.max_IslandLevel + 1; i++) { comboBox1.Items.Add(i); comboBox5.Items.Add(i); } comboBox1.SelectedIndex = 0; comboBox2.SelectedIndex = 0; comboBox5.SelectedIndex = 0; favoList = TreasureCalc.TryReadFile(dirName + favoListName); UI_SetFavoList(); charList = TreasureCalc.TryReadFile(dataDirName + charListName); radioButtons1 = new RadioButton[] { radioButton0, radioButton1, radioButton2, radioButton3, radioButton7 }; radioButtons2 = new RadioButton[] { radioButton4, radioButton5, radioButton6 }; }
private void SetDungeonIds() { string[] texts = TreasureCalc.TryReadFile(dataDirName + dungeonListName); if (texts == null) { return; } List <int>[] vs = new List <int> [texts.Length]; for (int i = 0; i < texts.Length; i++) { if (texts[i] == "") { continue; } string[] strs = texts[i].Split(','); vs[i] = new List <int>(); for (int j = 0; j < strs.Length; j++) { vs[i].Add(TreasureCalc.IntParse(strs[j])); } } dungeonIds = vs; }
private void SetMapIds() { string[] texts = TreasureCalc.TryReadFile(dataDirName + mapIdListName); if (texts == null) { return; } int[][] vs = new int[texts.Length][]; for (int i = 0; i < texts.Length; i++) { if (texts[i] == "") { continue; } string[] strs = texts[i].Split(','); vs[i] = new int[strs.Length]; for (int j = 0; j < strs.Length; j++) { vs[i][j] = TreasureCalc.IntParse(strs[j]); } } mapIds = vs; }
private void ReadIni() { string fileName = dirName + iniName; if (File.Exists(fileName)) { string[] strs = File.ReadAllLines(fileName, Encoding.UTF8); if (strs.Length < 17) { return; } checkBox1.Checked = strs[0] == "True"; checkBox2.Checked = strs[1] == "True"; checkBox3.Checked = strs[2] == "True"; worldSeedText.Text = strs[3]; mapIdNum3.Text = strs[4]; SetRadioButtonChecked(radioButtons1, strs[5]); SetRadioButtonChecked(radioButtons2, strs[6]); SetcomboBoxSelected(comboBox1, strs[7]); SetcomboBoxSelected(comboBox2, strs[8]); SetcomboBoxSelected(comboBox3, strs[9]); numericUpDown1.Text = strs[10]; numericUpDown2.Text = strs[11]; SetcomboBoxSelected(comboBox4, strs[12]); SetcomboBoxSelected(comboBox5, strs[13]); checkBox4.Checked = strs[14] == "True"; numericUpDown3.Text = strs[15]; numericUpDown4.Text = strs[16]; tabControl1.SelectedIndex = strs[17] == "1" ? 1 : 0; fileName = dirName + searchListName; if (!File.Exists(fileName)) { return; } string[] texts = TreasureCalc.TryReadFile(fileName); SetSearchText(texts); } }
private TreasureBoxData[] SetTreBoxList_Sub(string fileName) { string[] strs = TreasureCalc.TryReadFile(fileName); if (strs == null) { return(null); } TreasureBoxData[] treBoxs = new TreasureBoxData[strs.Length]; string name = Path.GetFileNameWithoutExtension(fileName); for (int i = 0; i < strs.Length; i++) { if (strs[i] == "" || strs[i] == null) { treBoxs[i] = new TreasureBoxData(); continue; } string[] s = strs[i].Split(','); if (s.Length < 7) { treBoxs[i] = new TreasureBoxData(); continue; } if (Double.TryParse(s[4], out double y) && y < -5000) { int index = (int)((y + 5000) / -10000); treBoxs[i] = new TreasureBoxData(s, name, index); } else { treBoxs[i] = new TreasureBoxData(s, name); } } return(treBoxs); }