private async void ConfirmButton_Click(object sender, EventArgs e) { XMLInteraction.MaterialParametersArrayList.Add(new MaterialParameter(ParameterName.Text, "", MaterialParameterType.GetMaterialParameterType("integer"), "0")); await XMLInteraction.WriteXmlParameters(MainWindow.completeUserDataPath); Parent.RefreshMaterialParameterList(); Close(); }
private async void ConfirmButton_Click(object sender, EventArgs e) { string[] filters = textBox1.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); parameterInfo.ProxyFilterArray.Clear(); parameterInfo.ProxyFilterArray.AddRange(filters); await XMLInteraction.WriteXmlParameters(MainWindow.completeUserDataPath); Close(); }
private async void Form2_FormClosing(object sender, FormClosingEventArgs e) { try { await XMLInteraction.WriteXmlParameters(MainWindow.completeUserDataPath); Parent.RefreshMaterialParameterList(); } catch (IOException) { toolStripStatusLabel1.Text = "Could not save settings. Configuration file may be missing or locked."; e.Cancel = true; } }
private async void MaterialParameterList_MouseClick(object sender, MouseEventArgs e) { //HACK: https://stackoverflow.com/a/4579701 if ((e.Button == MouseButtons.Left) & (e.X > 13)) { MaterialParameter selectedParameter = materialParameterDisplayList[materialParameterList.SelectedIndex].Param; materialParameterList.SetItemChecked(this.materialParameterList.SelectedIndex, !this.materialParameterList.GetItemChecked(this.materialParameterList.SelectedIndex)); await XMLInteraction.WriteXmlParameters(completeUserDataPath); overwriteModeComboBox.SelectedIndex = selectedParameter.ParamForce; randomizerOffsetNumeric.DecimalPlaces = 7; deviationSettingsParam1Label.Text = "Parameter Random Deviation"; deviationSettingsParam2Label.Hide(); deviationSettingsParam3Label.Hide(); randomizerOffsetNumeric2.Hide(); randomizerOffsetNumeric3.Hide(); if (selectedParameter.ParamType.ToString() == "integer") //Consider case. { randomizerOffsetNumeric.DecimalPlaces = 0; deviationSettingsGroupBox.Show(); } else if (selectedParameter.ParamType.ToString() == "bool" || selectedParameter.ParamType.ToString() == "proxy") { deviationSettingsGroupBox.Hide(); } else if (selectedParameter.ParamType.ToString().Contains("vector3")) { deviationSettingsGroupBox.Show(); toolStripStatusLabel1.Text = "Vector3 randomization is currently unimplemented. These settings will not be saved."; deviationSettingsParam1Label.Text = "Parameter 1 Random Deviation"; deviationSettingsParam1Label.Show(); deviationSettingsParam2Label.Show(); deviationSettingsParam3Label.Show(); randomizerOffsetNumeric.Show(); randomizerOffsetNumeric2.Show(); randomizerOffsetNumeric3.Show(); } randomizerChanceLabel.Text = selectedParameter.RandomizerChance.ToString(); randomizerChanceTrackBar.Value = selectedParameter.RandomizerChance; randomizerOffsetNumeric.Value = (decimal)selectedParameter.RandomizerOffset; parameterSettingsGroupBox.Show(); } }
private async void MainWindow_FormClosing(object sender, FormClosingEventArgs e) { await XMLInteraction.WriteXmlParameters(completeUserDataPath); }