private void btnAdd_Click(object sender, EventArgs e) { var edtior = new ShaderOptionsEditBox(); edtior.LoadOption("", ""); if (edtior.ShowDialog() == DialogResult.OK) { shaderOptionsListView.AddObject(new Options() { Name = edtior.textBoxName.Text, Value = edtior.textBoxValue.Text, }); material.shaderassign.options.Add(edtior.textBoxName.Text, edtior.textBoxValue.Text); } }
private void shaderOptionsListView_DoubleClick(object sender, EventArgs e) { int ActiveIndex = shaderOptionsListView.SelectedIndices[0]; if (shaderOptionsListView.SelectedObject != null) { var option = (Options)shaderOptionsListView.SelectedObject; var edtior = new ShaderOptionsEditBox(); edtior.LoadOption(option.Name, option.Value); if (edtior.ShowDialog() == DialogResult.OK) { option.Name = edtior.textBoxName.Text; option.Value = edtior.textBoxValue.Text; } } }
private void btnAdd_Click(object sender, EventArgs e) { var result = MessageBox.Show("NOTE! Shader Options are link by shaders. These are not possible to edit yet, do you want to continue?", "Material Editor", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); if (result == DialogResult.OK) { var edtior = new ShaderOptionsEditBox(); edtior.LoadOption("", ""); if (edtior.ShowDialog() == DialogResult.OK) { shaderOptionsListView.AddObject(new Options() { Name = edtior.textBoxName.Text, Value = edtior.textBoxValue.Text, }); material.shaderassign.options.Add(edtior.textBoxName.Text, edtior.textBoxValue.Text); } } }